You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an example fix. The problem is that $HOME is defined but we sub it with $env:HOME
# Apply the additions to the system PATH$global:_ENVR_PATH_ADDITIONS.GetEnumerator().ForEach({
$key=$($_.Key)
$val=$($_.Value)
if ($null-eq$val) {
continue
}
# expand the variables - Windows could have $env:<val> or $<val>$env_val=$ExecutionContext.InvokeCommand.ExpandString($val.Replace('$','$env:'))
$exp_val=$ExecutionContext.InvokeCommand.ExpandString($val)
if ((Test-Path-Path "$env_val") -and (Test-Path-Path "$exp_val")) {
Write-Host"ERROR - $key=$val is ambigious because both $env_val and $exp_val are valid paths"-ForegroundColor Red
unsource
exit1
}
if (Test-Path-Path "$env_val") {
$path_addition=$env_val
} elseif (Test-Path-Path "$exp_val") {
$path_addition=$exp_val
} else {
Write-Host"ERROR - $key=$val is not a directory."-ForegroundColor Red
unsource
exit1
}
foreach ($folderin$(Get-Item env:path).value.split($([System.IO.Path]::PathSeparator))) {
if ($folder-eq$path_addition) {
$duplicate=1
}
}
if ($duplicate-eq1) {
continue
}
$Env:PATH="$path_addition$([System.IO.Path]::PathSeparator)$Env:PATH"
})
The text was updated successfully, but these errors were encountered:
Here's an example fix. The problem is that $HOME is defined but we sub it with $env:HOME
The text was updated successfully, but these errors were encountered: