'Get-AzDataFactoryV2Trigger' is not recognized

KANNIBALA MISKIN KANNISAH 31 Reputation points
2022-10-19T08:25:48.257+00:00

I was trying to stop the ADF triggers during Deployment using YML. While it trying to execute the below powershell script, it throwing an exception.
Please help.

Script:
$triggersADF = Get-AzDataFactoryV2Trigger -DataFactoryName $DataFactoryName -ResourceGroupName $ResourceGroupName
$triggersADF | ForEach-Object { Stop-AzDataFactoryV2Trigger -ResourceGroupName $ResourceGroupName -DataFactoryName $DataFactoryName -Name $_.name -Force -ErrorAction Ignore}

Error:
The term 'Get-AzDataFactoryV2Trigger' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\a\1\s\<>\Netic-SetADFTriggerState_Stop.ps1:11 char:1

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,886 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,432 Reputation points Microsoft Employee
    2022-10-20T04:56:23.763+00:00

    Hello @KANNIBALA MISKIN KANNISAH ,

    Thanks for the question and using MS Q&A platform.

    I tried to reproduce the issue but when I tried in my machine, I haven't noticed any issues with it.

    252248-image.png

    Could you please verify if Az.DataFactory module was installed. If not, then please import the module and retry again.

    252257-image.png

    Let us know how it goes.

    Thank you