I have a Powershell script which returns a string value. I'm invoking this script using a AzurePowerShell task and I want to retain the returned value to use it in my subsequent tasks within the same pipeline. How can I do that? Any ideas, please?
Script Powershelltest.ps1:
function a {
<<processing steps>>
return $(testString)
}
Pipeline:
- task: AzurePowerShell@
ScriptPath: Powershelltest.ps1 (calls the above powershell script)
- task: AzureCLI@
inlineScript: |
use the value from $testString(??)
How can I catch the return value from Powershell in the first task (AzurePowerShell) and use it in AzureCLI task?
Thanks