Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jrotello/0b6d3bb86578b5d70e92e0167a4beb61 to your computer and use it in GitHub Desktop.
Save jrotello/0b6d3bb86578b5d70e92e0167a4beb61 to your computer and use it in GitHub Desktop.
Export ARM Template outputs as pipeline vars
$outputs= $env:ArmOutputs | convertfrom-json
$outputs
# Export pipeline variables for each ARM output value:
$props = ($outputs | Get-Member -MemberType NoteProperty)
foreach($p in $props) {
# this next line is to write one of these for each output value:
# --> "##vso[task.setvariable variable=websiteName]web-abcdefghi"
$name = $p.Name
$value = $outputs.$name.value
Write-Host "##vso[task.setvariable variable=$name]$value"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment