FortiPower / PowerFGT

PowerShell module to manage Fortinet (FortiGate) Firewall
Apache License 2.0
108 stars 36 forks source link

Get-FGTMonitorSystemConfigBackup with vdom argument does not give return config for only that vdom #271

Open johan-kummeneje-complior opened 1 month ago

johan-kummeneje-complior commented 1 month ago

When using the Get-FGTMonitorSystemConfigBackup command with -vdom vdomX it will return the full config.

This is easily fixed as the scope just needs to be changed from global to vdom if vdom is given on commandline.

$scope=global 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=$scope'
        $body = ""
    }
    else {
        $method = "post"
        $uri = 'api/v2/monitor/system/config/backup'
        $body = @{
            "scope" = "$scope"
        }
    }
alagoutte commented 1 month ago

Hi @johan-kummeneje-complior

thanks for the report ! Can you push a PR with the fix ?

johan-kummeneje-complior commented 1 month ago

Pull request https://github.com/FortiPower/PowerFGT/pull/272 is created.