mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-30 09:14:59 +02:00
Fix install path check (#633)
* update check for openssh directory in PATH * add closing parentheses
This commit is contained in:
parent
f2ee7ea5fa
commit
5124f3dcd4
@ -839,7 +839,7 @@ Function Add-MachinePath {
|
|||||||
|
|
||||||
if (Test-Path $FilePath) {
|
if (Test-Path $FilePath) {
|
||||||
$machinePath = (Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
|
$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
|
$newPath = $FilePath + ’;’ + $machinePath
|
||||||
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH –Value $newPath
|
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH –Value $newPath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user