From 2eb82b61b71c2c062b33f59e04b2fb8533e0fe3c Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 16 Feb 2024 10:40:40 +0100 Subject: [PATCH] ISDB: Fix uri when use before FortiOS 6.4.x --- PowerFGT/Public/cmdb/firewall/internet-service-name.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PowerFGT/Public/cmdb/firewall/internet-service-name.ps1 b/PowerFGT/Public/cmdb/firewall/internet-service-name.ps1 index 32dcb7187..6541b6031 100644 --- a/PowerFGT/Public/cmdb/firewall/internet-service-name.ps1 +++ b/PowerFGT/Public/cmdb/firewall/internet-service-name.ps1 @@ -91,6 +91,13 @@ function Get-FGTFirewallInternetServiceName { $invokeParams.add( 'vdom', $vdom ) } + #no the same URI before FortiOS 6.4.x + if ($connection.version -lt "6.4.0") { + $uri = 'api/v2/cmdb/firewall/internet-service' + } + else { + $uri = 'api/v2/cmdb/firewall/internet-service-name' + } #Filtering switch ( $PSCmdlet.ParameterSetName ) { "name" { @@ -111,7 +118,7 @@ function Get-FGTFirewallInternetServiceName { $invokeParams.add( 'filter_type', $filter_type ) } - $response = Invoke-FGTRestMethod -uri 'api/v2/cmdb/firewall/internet-service-name' -method 'GET' -connection $connection @invokeParams + $response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection @invokeParams $response.results }