Fix install path check (#633)

* update check for openssh directory in PATH

* add closing parentheses
This commit is contained in:
Tess Gauthier 2022-11-11 12:41:10 -05:00 committed by GitHub
parent f2ee7ea5fa
commit 5124f3dcd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -839,7 +839,7 @@ Function Add-MachinePath {
if (Test-Path $FilePath) {
$machinePath = (Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
if (-not $machinePath.ToLower().Contains("$FilePath;".ToLower()))
if (-not ($machinePath.ToLower().Contains("$FilePath;".ToLower()) -or $machinePath.ToLower().Contains("$FilePath\;".ToLower())))
{
$newPath = $FilePath + ; + $machinePath
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH Value $newPath