diff --git a/PowerFGT/Public/monitor/firewall/session.ps1 b/PowerFGT/Public/monitor/firewall/session.ps1 index 4d10bcbba..e9eadcaf2 100644 --- a/PowerFGT/Public/monitor/firewall/session.ps1 +++ b/PowerFGT/Public/monitor/firewall/session.ps1 @@ -67,7 +67,13 @@ function Get-FGTMonitorFirewallSession { $count = 1000 } - $uri = "api/v2/monitor/firewall/session?count=${count}" + #before 7.6.x, it is session (and not sessions) (already available with 7.4.x) but session drop with 7.6.) + if ($connection.version -lt "7.6.0") { + $uri = "api/v2/monitor/firewall/session?count=${count}" + } + else { + $uri = "api/v2/monitor/firewall/sessions?count=${count}" + } if ( $PsBoundParameters.ContainsKey('summary') ) { $uri += "&summary=$true" diff --git a/PowerFGT/Public/monitor/system/config/backup.ps1 b/PowerFGT/Public/monitor/system/config/backup.ps1 index 5e2566f15..2ae22cd17 100644 --- a/PowerFGT/Public/monitor/system/config/backup.ps1 +++ b/PowerFGT/Public/monitor/system/config/backup.ps1 @@ -50,8 +50,21 @@ function Get-FGTMonitorSystemConfigBackup { $invokeParams.add( 'vdom', $vdom ) } - $uri = 'api/v2/monitor/system/config/backup?scope=global' - $response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection @invokeParams + #before 7.6.x, config/backup is available with get method and using paramater + if ($connection.version -lt "7.6.0") { + $method = "get" + $uri = 'api/v2/monitor/system/config/backup?scope=global' + $body = "" + } + else { + $method = "post" + $uri = 'api/v2/monitor/system/config/backup' + $body = @{ + "scope" = "global" + } + } + + $response = Invoke-FGTRestMethod -uri $uri -method $method -body $body -connection $connection @invokeParams $response } diff --git a/Tests/integration/SystemSettings.Tests.ps1 b/Tests/integration/SystemSettings.Tests.ps1 index 64ddf7480..dff3ecb9c 100644 --- a/Tests/integration/SystemSettings.Tests.ps1 +++ b/Tests/integration/SystemSettings.Tests.ps1 @@ -53,8 +53,8 @@ Describe "Set System Settings" { $script:settings = Get-FGTSystemSettings } - #Coming with FortiOS 7.2.x and need for some feature (like waf, ztna.. ) - It "Change gui-proxy-inspection to enable" -skip:($fgt_version -lt "7.2.0") { + #Coming with FortiOS 7.2.x and need for some feature (like waf, ztna.. ) and remove with 7.6.0... + It "Change gui-proxy-inspection to enable" -skip:($fgt_version -lt "7.2.0" -or $fgt_version -ge "7.6.0") { Set-FGTSystemSettings -gui_proxy_inspection $ss = Get-FGTSystemSettings $ss.'gui-proxy-inspection' | Should -Be "enable" @@ -351,7 +351,7 @@ Describe "Set System Settings" { $ss.'lldp-reception' | Should -Be "global" } - It "Change gui-proxy-inspection to disable" -skip:($fgt_version -lt "7.2.0") { + It "Change gui-proxy-inspection to disable" -skip:($fgt_version -lt "7.2.0" -or $fgt_version -ge "7.6.0") { Set-FGTSystemSettings -gui_proxy_inspection:$false $ss = Get-FGTSystemSettings $ss.'gui-proxy-inspection' | Should -Be "disable"