We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2ee7ea commit 5124f3dCopy full SHA for 5124f3d
contrib/win32/openssh/OpenSSHUtils.psm1
@@ -839,7 +839,7 @@ Function Add-MachinePath {
839
840
if (Test-Path $FilePath) {
841
$machinePath = (Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
842
- if (-not $machinePath.ToLower().Contains("$FilePath;".ToLower()))
+ if (-not ($machinePath.ToLower().Contains("$FilePath;".ToLower()) -or $machinePath.ToLower().Contains("$FilePath\;".ToLower())))
843
{
844
$newPath = $FilePath + ’;’ + $machinePath
845
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH –Value $newPath
0 commit comments