diff --git a/PowerFGT/Public/monitor/system/config/backup.ps1 b/PowerFGT/Public/monitor/system/config/backup.ps1 index 2ae22cd17..c9842f181 100644 --- a/PowerFGT/Public/monitor/system/config/backup.ps1 +++ b/PowerFGT/Public/monitor/system/config/backup.ps1 @@ -1,4 +1,4 @@ -# +# # Copyright 2022, Alexis La Goutte # # SPDX-License-Identifier: Apache-2.0 @@ -42,28 +42,29 @@ function Get-FGTMonitorSystemConfigBackup { Process { + $scope="global" $invokeParams = @{ } if ( $PsBoundParameters.ContainsKey('skip') ) { $invokeParams.add( 'skip', $skip ) } if ( $PsBoundParameters.ContainsKey('vdom') ) { $invokeParams.add( 'vdom', $vdom ) + $scope="vdom" } #before 7.6.x, config/backup is available with get method and using paramater if ($connection.version -lt "7.6.0") { $method = "get" - $uri = 'api/v2/monitor/system/config/backup?scope=global' + $uri = "api/v2/monitor/system/config/backup?scope=$scope" $body = "" } else { $method = "post" $uri = 'api/v2/monitor/system/config/backup' $body = @{ - "scope" = "global" + "scope" = "$scope" } } - $response = Invoke-FGTRestMethod -uri $uri -method $method -body $body -connection $connection @invokeParams $response }