mirror of
https://github.com/Grace-Solutions/Invoke-OpenSSHConfiguration.git
synced 2026-07-26 11:38:14 +00:00
Fix TimeSpan error and firewall profile enumeration
- Added ExecutionTimeout and ExecutionTimeoutInterval to ssh-keygen calls (2 min timeout)
- Added ExecutionTimeout and ExecutionTimeoutInterval to sshd -t validation (30 sec timeout)
- Fixed firewall profile enumeration: use string array instead of unavailable type
- Profiles now use simple array: @('Domain', 'Private', 'Public')
This commit is contained in:
@@ -383,6 +383,8 @@ Switch (Test-ProcessElevationStatus)
|
||||
$StartProcessWithOutputParameters.AcceptableExitCodeList = New-Object -TypeName 'System.Collections.Generic.List[System.String]'
|
||||
$StartProcessWithOutputParameters.AcceptableExitCodeList.Add('0')
|
||||
$StartProcessWithOutputParameters.CreateNoWindow = $True
|
||||
$StartProcessWithOutputParameters.ExecutionTimeout = [System.Timespan]::FromMinutes(2)
|
||||
$StartProcessWithOutputParameters.ExecutionTimeoutInterval = [System.Timespan]::FromSeconds(5)
|
||||
$StartProcessWithOutputParameters.LogOutput = $True
|
||||
$StartProcessWithOutputParameters.ContinueOnError = $False
|
||||
$StartProcessWithOutputParameters.Verbose = $True
|
||||
@@ -714,6 +716,8 @@ Switch (Test-ProcessElevationStatus)
|
||||
$ValidateConfigParameters.AcceptableExitCodeList = New-Object -TypeName 'System.Collections.Generic.List[System.String]'
|
||||
$ValidateConfigParameters.AcceptableExitCodeList.Add('0')
|
||||
$ValidateConfigParameters.CreateNoWindow = $True
|
||||
$ValidateConfigParameters.ExecutionTimeout = [System.Timespan]::FromSeconds(30)
|
||||
$ValidateConfigParameters.ExecutionTimeoutInterval = [System.Timespan]::FromSeconds(5)
|
||||
$ValidateConfigParameters.LogOutput = $True
|
||||
$ValidateConfigParameters.ContinueOnError = $True
|
||||
$ValidateConfigParameters.Verbose = $True
|
||||
@@ -798,7 +802,7 @@ Switch (Test-ProcessElevationStatus)
|
||||
|
||||
#region Windows Firewall Configuration (Automatic)
|
||||
$FirewallRuleName = 'OpenSSH-Server-In-TCP'
|
||||
$FirewallProfiles = [System.Enum]::GetValues([Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetSecurity.Profile])
|
||||
$FirewallProfiles = @('Domain', 'Private', 'Public')
|
||||
|
||||
ForEach ($FirewallProfile In $FirewallProfiles)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user