Skip to content

Commit

Permalink
fix(ssid-policy): it is not available before FortiOS 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Jan 26, 2025
1 parent 18f7110 commit 247d2e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions PowerFGT/Public/cmdb/wireless/ssid-policy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
5 changes: 4 additions & 1 deletion Tests/integration/Connection.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 247d2e4

Please sign in to comment.