Skip to content

Commit 5124f3d

Browse files
authored
Fix install path check (#633)
* update check for openssh directory in PATH * add closing parentheses
1 parent f2ee7ea commit 5124f3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/win32/openssh/OpenSSHUtils.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ Function Add-MachinePath {
839839

840840
if (Test-Path $FilePath) {
841841
$machinePath = (Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
842-
if (-not $machinePath.ToLower().Contains("$FilePath;".ToLower()))
842+
if (-not ($machinePath.ToLower().Contains("$FilePath;".ToLower()) -or $machinePath.ToLower().Contains("$FilePath\;".ToLower())))
843843
{
844844
$newPath = $FilePath + ; + $machinePath
845845
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH –Value $newPath

0 commit comments

Comments
 (0)