Update dnvm.
This commit is contained in:
parent
e46896b7cd
commit
1f0531f65e
|
|
@ -513,20 +513,24 @@ function Change-Path() {
|
||||||
|
|
||||||
$newPath = $prependPath
|
$newPath = $prependPath
|
||||||
foreach($portion in $existingPaths.Split(';')) {
|
foreach($portion in $existingPaths.Split(';')) {
|
||||||
$skip = $portion -eq ""
|
if(![string]::IsNullOrWhiteSpace($portion)) {
|
||||||
foreach($removePath in $removePaths) {
|
$skip = $portion -eq ""
|
||||||
$removePrefix = if($removePath.EndsWith("\")) { $removePath } else { "$removePath\" }
|
foreach($removePath in $removePaths) {
|
||||||
|
if(![string]::IsNullOrWhiteSpace($removePath)) {
|
||||||
|
$removePrefix = if($removePath.EndsWith("\")) { $removePath } else { "$removePath\" }
|
||||||
|
|
||||||
if ($removePath -and (($portion -eq $removePath) -or ($portion.StartsWith($removePrefix)))) {
|
if ($removePath -and (($portion -eq $removePath) -or ($portion.StartsWith($removePrefix)))) {
|
||||||
_WriteDebug " Removing '$portion' because it matches '$removePath'"
|
_WriteDebug " Removing '$portion' because it matches '$removePath'"
|
||||||
$skip = $true
|
$skip = $true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!$skip) {
|
||||||
if (!$skip) {
|
if(![String]::IsNullOrWhiteSpace($newPath)) {
|
||||||
if(![String]::IsNullOrWhiteSpace($newPath)) {
|
$newPath += ";"
|
||||||
$newPath += ";"
|
}
|
||||||
|
$newPath += $portion
|
||||||
}
|
}
|
||||||
$newPath += $portion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $newPath
|
return $newPath
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue