【发布时间】:2022-01-06 22:48:45
【问题描述】:
我在 Azure DevOps 中定义了以下管道,以在 linux 代理中运行 Az 模块 powershell。
- main
#pool: Default
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureCLI@2
inputs:
azureSubscription: sp-test
scriptType: pscore
scriptLocation: 'inlineScript'
inlineScript: |
$Subscriptions = Get-AzSubscription
displayName: 'Run Powershell'
它给了我一个错误
Get-AzSubscription : The term 'Get-AzSubscription' is not recognized as a name of a cmdlet, function, script file, or executable program.
同样的方法适用于运行 az 命令的 bash。我需要先在 linux 代理上安装任何 Powershell 模块吗?
【问题讨论】:
标签: azure-devops azure-pipelines azure-powershell