Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global(System): Change port (HTTP/HTTPS) on connection on the same time #232

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion PowerFGT/Public/cmdb/system/global.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,20 @@ function Set-FGTSystemGlobal {
}

if ($PSCmdlet.ShouldProcess("Global", 'Configure Settings')) {
Invoke-FGTRestMethod -method "PUT" -body $_sg -uri $uri -connection $connection @invokeParams | Out-Null
Invoke-FGTRestMethod -method "PUT" -body $_sg -uri $uri -connection $connection @invokeParams -ErrorAction SilentlyContinue | Out-Null
#Change the admin port if you use for the connection
if ( $PsBoundParameters.ContainsKey('admin_port') -and $connection.httpOnly ) {
$connection.port = $admin_port
#Add Sleep 2 seconds for wait on the server...
Start-Sleep 2
}

#Change the admin (secure) port if you use for the connection
if ( $PsBoundParameters.ContainsKey('admin_sport') -and $connection.httpOnly -eq $false ) {
$connection.port = $admin_sport
#Add Sleep 2 seconds for wait on the server...
Start-Sleep 2
}
}

Get-FGTSystemGlobal -connection $connection @invokeParams
Expand Down
Loading