fix install-sshd incompatability with windows pwsh 5.1 (#590)

This commit is contained in:
Tess Gauthier 2022-03-24 13:32:32 -04:00 committed by GitHub
parent aa0d37b16e
commit 9598cec2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -86,7 +86,13 @@ if (Test-Path $sshAgentRegPath)
$moduliPath = Join-Path $PSScriptRoot "moduli"
if (Test-Path $moduliPath -PathType Leaf)
{
Repair-ModuliFilePermission -FilePath $moduliPath @psBoundParameters -confirm:$false
# if user calls .\install-sshd.ps1 with -confirm, use that
# otherwise, need to preserve legacy behavior
if (-not $PSBoundParameters.ContainsKey('confirm'))
{
$PSBoundParameters.add('confirm', $false)
}
Repair-ModuliFilePermission -FilePath $moduliPath @psBoundParameters
}
# If %programData%/ssh folder already exists, verify and, if necessary and approved by user, fix permissions