Last active
September 15, 2020 15:28
-
-
Save asizikov/ffc613e4b81189545accd87212ace55c to your computer and use it in GitHub Desktop.
save az cli output as var and use it later
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
- job: | |
displayName: Your job | |
variables: | |
var-name: 'unknown' | |
steps: | |
- task: AzureCLI@2 | |
inputs: | |
azureSubscription: 'sp-connection-name' | |
scriptType: 'pscore' | |
scriptLocation: 'inlineScript' | |
inlineScript: | | |
$tmp= & az blah-blah-blah -o tsv | |
Write-Output("##vso[task.setvariable variable=var-name;]$tmp") | |
- script: | | |
echo $(var-name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment