diff options
author | Joni Jäntti <joni.jantti@qt.io> | 2017-09-04 13:25:44 +0300 |
---|---|---|
committer | Joni Jäntti <joni.jantti@qt.io> | 2017-09-04 12:11:17 +0000 |
commit | dbf737a5c098ffe5c38413c2f289790d87ec6131 (patch) | |
tree | 8a558100b84bc96e1bd42b1efc2615d36a65b9b9 /coin/provisioning/common/helpers.ps1 | |
parent | 4e1f4665c5ed631e18d2fa4910fd1a612b40539a (diff) |
Fix Add-Path helper function and start using it in scripts
This function was broken and only added the latest addition to the
actual PATH.
Change-Id: Ida352c7b605c1b9748bb98e4f51ce68a765c3ce3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'coin/provisioning/common/helpers.ps1')
-rw-r--r-- | coin/provisioning/common/helpers.ps1 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coin/provisioning/common/helpers.ps1 b/coin/provisioning/common/helpers.ps1 index 3f7f0a68..846f58a5 100644 --- a/coin/provisioning/common/helpers.ps1 +++ b/coin/provisioning/common/helpers.ps1 @@ -86,7 +86,9 @@ function Add-Path [string]$Path ) echo "Adding $Path to Path" - [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$Path", [EnvironmentVariableTarget]::Machine) + + $oldPath = [System.Environment]::GetEnvironmentVariable('Path', 'Machine') + [Environment]::SetEnvironmentVariable("Path", $oldPath + ";$Path", [EnvironmentVariableTarget]::Machine) } function is64bitWinHost |