Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过使用powershell任务,使用发布管道自动化Azure数据工厂触发器_Powershell_Azure Pipelines Release Pipeline_Release Management_Azure Data Factory 2 - Fatal编程技术网

通过使用powershell任务,使用发布管道自动化Azure数据工厂触发器

通过使用powershell任务,使用发布管道自动化Azure数据工厂触发器,powershell,azure-pipelines-release-pipeline,release-management,azure-data-factory-2,Powershell,Azure Pipelines Release Pipeline,Release Management,Azure Data Factory 2,我是DevOps新手,我正在尝试在部署时使用powershell更改Azure Data Factory中的Azure Data Factory触发器starttime和endtime属性 我找到了这个,并试图在PowerShell中跟踪。当我在命令下运行时,出现以下错误 PS C:\> Set-AzDataFactoryV2Trigger -ResourceGroupName "ADF" -DataFactoryName "WikiADF" -Name "ScheduledTrigger

我是DevOps新手,我正在尝试在部署时使用powershell更改Azure Data Factory中的Azure Data Factory触发器starttime和endtime属性

我找到了这个,并试图在PowerShell中跟踪。当我在命令下运行时,出现以下错误

PS C:\> Set-AzDataFactoryV2Trigger -ResourceGroupName "ADF" -DataFactoryName "WikiADF" -Name "ScheduledTrigger" -DefinitionFile ".\scheduledTrigger.json"

Set-AzureRmDataFactoryV2 : The term 'Set-AzureRmDataFactoryV2' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:16
+ $DataFactory = Set-AzureRmDataFactoryV2 -ResourceGroupName $ResGrp.Re ...
+                ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Set-AzureRmDataFactoryV2:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我搜索了这个问题,发现这个问题在

如果有人能够解决这个问题或者已经解决了,请帮助我


注意:Azure DataFactory触发器标记在StackOverflow中不可用,因此我无法添加它。

非常同意Nick的意见:

任何时候,您看到术语“xyz”都不会被识别为 powershell中的cmdlet,表示您尚未安装该模块

其实,在你的问题上,这个错误也是由这个原因造成的。我认为你不应该为你的Powershell安装Az模块

Az模块是Azure PowerShell cmdlet的汇总模块。安装它可以下载所有可用的Azure资源管理器模块,包括您正在使用的Set-AzDataFactoryV2Trigger,并使其cmdlet可供使用

尝试此命令为Powershell安装Az模块:

Install-Module -Name Az -AllowClobber -Scope CurrentUser
由于默认情况下,PowerShell gallery未配置为PowerShellGet的受信任存储库,因此第一次使用PSGallery时,您将看到提示,如果要从PSGallery获取Az模块,您需要确保该提示。只要回答“是”或“是”就可以了

然后,您可以执行以下命令来检查Az模块:

 Get-InstalledModule -Name Az
当您看到以下消息时,表示Az模块已存在于Powershell中:

Install-Module -Name Az -AllowClobber -Scope CurrentUser

现在,再试一次,它会成功。

您似乎在发布管道中使用了PowerShell任务而不是Azure PowerShell任务

如果使用Azure PowerShell任务,您将不会遇到任何问题。

任何时候您看到术语“xyz”未被识别为PowerShell中cmdlet的名称,这意味着您尚未安装该模块。在页面顶部,它会告诉您需要安装哪个模块。