【发布时间】:2017-08-24 10:13:31
【问题描述】:
我想执行命令以删除远程 Azure 资源组上的主题或队列。命令之一是“Get-AzureRmServiceBusQueue”。
我在 VSTS 的托管代理中使用 Azure Powershell 任务(使用 Azure 资源管理器)。此任务使用 Azure Powershell 2.0.1。
当我执行释放时,代理返回此失败:
"[error]The term 'Get-AzureRmServiceBusQueue' 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."
我检查了 ServiceBus cmdlet 仅在较新版本的 Azure Powershell 中提供(例如:最新的 4.3.1)。
我可以执行“Install-Module -Name AzureRM”吗?
【问题讨论】:
-
我没有使用过 VSTS,也没有用于测试的帐户,但是,如果它运行的是 PowerShell 版本 5 或更高版本,您应该能够运行如图所示的安装 cmdlet。您还可以将其与
-RequiredVersion参数结合使用,以确保您为每个构建获得一致的版本。
标签: powershell azure azure-devops