diff --git a/PowerFGT/Public/cmdb/wireless/ssid-policy.ps1 b/PowerFGT/Public/cmdb/wireless/ssid-policy.ps1 index c574428e..da68348a 100644 --- a/PowerFGT/Public/cmdb/wireless/ssid-policy.ps1 +++ b/PowerFGT/Public/cmdb/wireless/ssid-policy.ps1 @@ -87,6 +87,11 @@ function Get-FGTWirelessSSIDPolicy { default { } } + #before 7.0.x, it is not available + if ($connection.version -lt "7.0.0") { + Throw "Wireless SSID Policy is not available before Forti OS 7.9" + } + #if filter value and filter_attribute, add filter (by default filter_type is equal) if ( $filter_value -and $filter_attribute ) { $invokeParams.add( 'filter_value', $filter_value ) diff --git a/Tests/integration/Connection.Tests.ps1 b/Tests/integration/Connection.Tests.ps1 index 9a3148a5..038444ce 100644 --- a/Tests/integration/Connection.Tests.ps1 +++ b/Tests/integration/Connection.Tests.ps1 @@ -368,9 +368,12 @@ Describe "Connect to a FortiGate (using multi connection)" { It "Use Multi connection for call Get Wireless Setting" { { Get-FGTWirelessSetting -connection $fgt } | Should -Not -Throw } - It "Use Multi connection for call Get Wireless SSID Policy" { + It "Use Multi connection for call Get Wireless SSID Policy (> 7.0.0)" -skip:($fgt_version -lt "7.0.0") { { Get-FGTWirelessSSIDPolicy -connection $fgt } | Should -Not -Throw } + It "Use Multi connection for call Get Wireless SSID Policy (< 7.0.0)" -skip:($fgt_version -ge "7.0.0") { + { Get-FGTWirelessSSIDPolicy -connection $fgt } | Should -Throw "Wireless SSID Policy is not available before Forti OS 6.4" + } It "Use Multi connection for call Get Wireless VAP (Virtual AP Profile)" { { Get-FGTWirelessVAP -connection $fgt } | Should -Not -Throw }