Az 版本为 null 在代理上本地不可用。Validate-VersionParameters:无法将值“null”转换为类型“System.Version”

Dee*_*esh 2 azure-powershell azure-devops

尝试在 Azure DevOps 中运行AzurePowerShell@5任务时遇到问题

\n
Az version null not avaiable locally on the agent. Downloading dynamically.\nValidate-VersionParameters: Cannot convert value \'null\' to type \'System.Version\'\nException: /home/vsts/work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.218.0/Utility.ps1:94\nLine |\n94 |  \xe2\x80\xa6             throw ("Could not find the module path with given version \xe2\x80\xa6\n |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n | Could not find the module path with given version.\n [![enter image description here][1]][1]\n
Run Code Online (Sandbox Code Playgroud)\n

错误快照

\n

Dee*_*esh 7

此任务需要参数azurePowerShellVersion。提供值“最新”或“其他”。

针对这个问题提出了一个 github 问题。https://github.com/MicrosoftDocs/azure-devops-docs/issues/11928

突出显示的参数是必需的。https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-powershell-v5?view=azure-pipelines

在此输入图像描述