File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ $branch = [uri ]::EscapeDataString($env: PSES_BRANCH )
2+ $buildsUrl = $env: VSTS_PSES_URL_TEMPLATE -f $branch
3+ $headers = @ {Authorization = " Bearer $env: SYSTEM_ACCESSTOKEN " }
4+ $builds = Invoke-RestMethod - ContentType application/ json - Uri $buildsUrl - Headers $headers
5+ Write-Host " Got PSES_BRANCH: ${env: PSES_BRANCH} "
6+ Write-Host " Requested URL: $buildsUrl "
7+ Write-Host " Got response:`n $ ( ConvertTo-Json $builds ) "
8+ Write-Host " setting PSES_BUILDID to $ ( $builds.value [0 ].Id) "
9+ Write-Host " ##vso[task.setvariable variable=PSES_BUILDID]$ ( $builds.value [0 ].Id) "
Original file line number Diff line number Diff line change 1+ $vstsVariables = @ {
2+ PSES_BRANCH = ' master'
3+ }
4+
5+ # Use VSTS's API to set an env vars
6+ foreach ($var in $vstsVariables.Keys )
7+ {
8+ $val = $vstsVariables [$var ]
9+ Write-Host " Setting var '$var ' to value '$val '"
10+ Write-Host " ##vso[task.setvariable variable=$var ]$val "
11+ }
You can’t perform that action at this time.
0 commit comments