Fix artifacts/variables.ps1 to check env vars in all caps

This commit is contained in:
Andrew Arnott 2020-03-06 13:12:28 -07:00
Родитель 3d164a2c0c
Коммит 43d492bdd1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: FD21E965BEF82456
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -12,8 +12,11 @@ Get-ChildItem -Path (Join-Path $PSScriptRoot (Join-Path .. variables)) |% {
$value = $null
if (-not $_.BaseName.StartsWith('_')) { # Skip trying to interpret special scripts
# First check the environment variables in case the variable was set in a queued build
if (Test-Path env:$($_.BaseName)) {
$value = Get-Content "env:$($_.BaseName)"
# Always use all caps for env var access because Azure Pipelines converts variables to upper-case for env vars,
# and on non-Windows env vars are case sensitive.
$envVarName = $_.BaseName.ToUpper()
if (Test-Path env:$envVarName) {
$value = Get-Content "env:$envVarName"
}
# If that didn't give us anything, try executing the script right now from its original position