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 }