错误信息:
[error]The term 'keyVaultName' 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.
开发azure devops YAML管道。我在Powershell任务中的内联脚本
- task: AzurePowerShell@4
inputs:
azureSubscription: '<REDACTED>'
ScriptType: 'InlineScript'
Inline: |
Install-Module -Name "AzureAD"
$keyVaultAdGroup = 'rkimkeyvault'
$keyVaultName = 'rkaksKeyVault'
正如你可以看到我显然有$
前面keyVaultName
,使这个变量。不知道为什么要尝试将其视为cmdlet。
我发现问题出在那些代码行之外。因此,使用分而治之的方法,我发现我的问题是在RoleNameGUID Write-Host“ ## vso [task.setvariable variable = roleNameGuid] $(roleNameGuid)”周围的(),我把那些括号拿走了,这很好。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句