我有一个返回字符串值的 Powershell 脚本。我使用 AzurePowerShell 任务调用此脚本,并且希望保留返回的值以便在同一管道内的后续任务中使用它。我怎样才能做到这一点?有什么想法吗?
脚本Powershelltest.ps1:
function a {
<<processing steps>>
return $(testString)
}
Run Code Online (Sandbox Code Playgroud)
管道:
- task: AzurePowerShell@
ScriptPath: Powershelltest.ps1 (calls the above powershell script)
- task: AzureCLI@
inlineScript: |
use the value from $testString(??)
Run Code Online (Sandbox Code Playgroud)
如何在第一个任务 (AzurePowerShell) 中捕获 Powershell 的返回值并在 AzureCLI 任务中使用它?
谢谢