如何设置管道';任务版本';在Azure Devops管道中的YAML中

如何设置管道';任务版本';在Azure Devops管道中的YAML中,azure,azure-pipelines-yaml,Azure,Azure Pipelines Yaml,如何在YAML中设置此值?这是来自Azure devops管道的 编辑:同一UI下有一个powershell版本(首选powershell版本),问题不在于此。您可以将其设置为 steps: - task: AzurePowerShell@4 displayName: 'Azure PowerShell script: FilePath' inputs: azureSubscription: 'Azure Demo' preferredAzurePowerShellVe

如何在YAML中设置此值?这是来自Azure devops管道的


编辑:同一UI下有一个powershell版本(首选powershell版本),问题不在于此。

您可以将其设置为

steps:
- task: AzurePowerShell@4
  displayName: 'Azure PowerShell script: FilePath'
  inputs:
    azureSubscription: 'Azure Demo'
    preferredAzurePowerShellVersion: 1.0.0
但是,通过单击YAML,您应该能够看到相关的YAML代码

设置在“@4”中


为什么不呢?我只是在发布管道中这样做了,你不能在发布管道中这样做,不管你是哪个管道,我都不能在发布管道和构建管道中看到它:)检查附带的图像
- task: AzurePowerShell@4