管道 Azure Devops 中的“术语 'Set-AzureRmDataFactoryV2' 未被识别为 cmdlet 的名称”错误

'The term 'Set-AzureRmDataFactoryV2' is not recognized as the name of a cmdlet' error in Pipeline Azure Devops

A​​zure Powershell AZ 模块在 azure devops 管道中仍然不起作用?

当我尝试 powershell 版本 4+ 并且代理是 2017 时出现此错误(也尝试了 windows 2019)

#Install-Module -Name Az -AllowClobber -Scope CurrentUser (is this needed? I tried with and #without and it fails)
Set-AzureRmDataFactoryV2 -ResourceGroupName "myRG" -Name "LLmenADF1" -Location "North Europe"

如果您使用的是 Powershell Az 模块,则 cmdlet 为:

Set-AzDataFactoryV2

您的 cmdlet 引用了旧库 AzureRM。要在从一个库迁移到另一个库时获得相同的 cmdlet,只需将 AzureRM 替换为 Az。

希望对您有所帮助!

@Martin Esteban Zurita 有迁移到 Az 命令的正确推荐解决方案

对于那些因任何原因不能t/won的人,只需 select Azure Powershell 任务的版本 3 即可使用 AzureRM 命令。