Skip to content

Commit

Permalink
session(firewall/monitor): Fix when use FortiOS 7.6.0
Browse files Browse the repository at this point in the history
We need to use sessions and not session for uri (already available with fortiOS 7.4.x...)
  • Loading branch information
alagoutte committed Aug 28, 2024
1 parent 723de3b commit 96d03ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PowerFGT/Public/monitor/firewall/session.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 96d03ef

Please sign in to comment.