diff options
Diffstat (limited to '.gitlab')
-rw-r--r-- | .gitlab/ci/vcvarsall.ps1 | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/.gitlab/ci/vcvarsall.ps1 b/.gitlab/ci/vcvarsall.ps1 index f91b100..f8c4150 100644 --- a/.gitlab/ci/vcvarsall.ps1 +++ b/.gitlab/ci/vcvarsall.ps1 @@ -1,9 +1,7 @@ $erroractionpreference = "stop" -cmd /c "`"$env:VCVARSALL`" $env:VCVARSPLATFORM -vcvars_ver=$env:VCVARSVERSION & set" | -foreach { - if ($_ -match "=") { - $v = $_.split("=") - [Environment]::SetEnvironmentVariable($v[0], $v[1]) - } +$all_env = cmd /c "`"$env:VCVARSALL`" $env:VCVARSPLATFORM -vcvars_ver=$env:VCVARSVERSION >NUL & powershell -Command `"Get-ChildItem env: | Select-Object -Property Key,Value | ConvertTo-Json`"" | ConvertFrom-Json + +foreach ($envvar in $all_env) { + [Environment]::SetEnvironmentVariable($envvar.Key, $envvar.Value) } |