Skip to content

Commit 9598cec

Browse files
authored
fix install-sshd incompatability with windows pwsh 5.1 (#590)
1 parent aa0d37b commit 9598cec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contrib/win32/openssh/install-sshd.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ if (Test-Path $sshAgentRegPath)
8686
$moduliPath = Join-Path $PSScriptRoot "moduli"
8787
if (Test-Path $moduliPath -PathType Leaf)
8888
{
89-
Repair-ModuliFilePermission -FilePath $moduliPath @psBoundParameters -confirm:$false
89+
# if user calls .\install-sshd.ps1 with -confirm, use that
90+
# otherwise, need to preserve legacy behavior
91+
if (-not $PSBoundParameters.ContainsKey('confirm'))
92+
{
93+
$PSBoundParameters.add('confirm', $false)
94+
}
95+
Repair-ModuliFilePermission -FilePath $moduliPath @psBoundParameters
9096
}
9197

9298
# If %programData%/ssh folder already exists, verify and, if necessary and approved by user, fix permissions

0 commit comments

Comments
 (0)