Created
October 31, 2019 13:28
-
-
Save jrotello/0b6d3bb86578b5d70e92e0167a4beb61 to your computer and use it in GitHub Desktop.
Export ARM Template outputs as pipeline vars
This file contains hidden or 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
$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