diff --git a/PowerFGT/Private/RestMethod.ps1 b/PowerFGT/Private/RestMethod.ps1 index d6b4e493..581c4580 100644 --- a/PowerFGT/Private/RestMethod.ps1 +++ b/PowerFGT/Private/RestMethod.ps1 @@ -67,18 +67,14 @@ function Invoke-FGTRestMethod { [switch]$skip, [Parameter(Mandatory = $false)] [String[]]$vdom, - [Parameter(Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter(Mandatory = $false, ParameterSetName = "filter")] [String]$filter, - [Parameter(Mandatory = $false)] - [Parameter (ParameterSetName = "filter_build")] + [Parameter(Mandatory = $false, ParameterSetName = "filter_build")] [string]$filter_attribute, - [Parameter(Mandatory = $false)] - [ValidateSet('equal', 'contains')] - [Parameter (ParameterSetName = "filter_build")] + [Parameter(Mandatory = $false, ParameterSetName = "filter_build")] + [ValidateSet('equal', 'notequal', 'contains', 'notcontains', 'less', 'lessorequal', 'greater', 'greaterorequal')] [string]$filter_type, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter_build")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [psobject]$filter_value, [Parameter(Mandatory = $false)] [psobject]$connection @@ -132,9 +128,27 @@ function Invoke-FGTRestMethod { "equal" { $filter_value = "==" + $filter_value } + "notequal" { + $filter_value = "!=" + $filter_value + } "contains" { $filter_value = "=@" + $filter_value } + "notcontains" { + $filter_value = "!@" + $filter_value + } + "less" { + $filter_value = "<" + $filter_value + } + "lessorequal" { + $filter_value = "<=" + $filter_value + } + "greater" { + $filter_value = ">" + $filter_value + } + "greaterorequal" { + $filter_value = ">=" + $filter_value + } #by default set to equal.. default { $filter_value = "==" + $filter_value @@ -169,4 +183,4 @@ function Invoke-FGTRestMethod { } -} \ No newline at end of file +} diff --git a/PowerFGT/Public/cmdb/firewall/address.ps1 b/PowerFGT/Public/cmdb/firewall/address.ps1 index 63c9dafa..a3a56839 100644 --- a/PowerFGT/Public/cmdb/firewall/address.ps1 +++ b/PowerFGT/Public/cmdb/firewall/address.ps1 @@ -209,17 +209,14 @@ function Get-FGTFirewallAddress { [string]$name, [Parameter (Mandatory = $false, ParameterSetName = "uuid")] [string]$uuid, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [string]$filter_attribute, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "name")] + [Parameter (Mandatory = $false, ParameterSetName = "name")] [Parameter (ParameterSetName = "uuid")] - [Parameter (ParameterSetName = "filter")] - [ValidateSet('equal', 'contains')] + [Parameter (ParameterSetName = "filter_build")] + [ValidateSet('equal', 'notequal', 'contains', 'notcontains', 'less', 'lessorequal', 'greater', 'greaterorequal')] [string]$filter_type = "equal", - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [psobject]$filter_value, [Parameter(Mandatory = $false)] [switch]$skip, @@ -463,4 +460,4 @@ function Remove-FGTFirewallAddress { End { } -} \ No newline at end of file +} diff --git a/PowerFGT/Public/cmdb/firewall/addressgroup.ps1 b/PowerFGT/Public/cmdb/firewall/addressgroup.ps1 index 6e8a79f5..a097ad75 100644 --- a/PowerFGT/Public/cmdb/firewall/addressgroup.ps1 +++ b/PowerFGT/Public/cmdb/firewall/addressgroup.ps1 @@ -264,17 +264,14 @@ function Get-FGTFirewallAddressGroup { [string]$name, [Parameter (Mandatory = $false, ParameterSetName = "uuid")] [string]$uuid, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [string]$filter_attribute, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "name")] + [Parameter (Mandatory = $false, ParameterSetName = "name")] [Parameter (ParameterSetName = "uuid")] - [Parameter (ParameterSetName = "filter")] - [ValidateSet('equal', 'contains')] + [Parameter (ParameterSetName = "filter_build")] + [ValidateSet('equal', 'notequal', 'contains', 'notcontains', 'less', 'lessorequal', 'greater', 'greaterorequal')] [string]$filter_type = "equal", - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [psobject]$filter_value, [Parameter(Mandatory = $false)] [switch]$skip, diff --git a/PowerFGT/Public/cmdb/firewall/ippool.ps1 b/PowerFGT/Public/cmdb/firewall/ippool.ps1 index 02b82d0e..feddade2 100644 --- a/PowerFGT/Public/cmdb/firewall/ippool.ps1 +++ b/PowerFGT/Public/cmdb/firewall/ippool.ps1 @@ -43,16 +43,13 @@ function Get-FGTFirewallIPPool { Param( [Parameter (Mandatory = $false, Position = 1, ParameterSetName = "name")] [string]$name, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [string]$filter_attribute, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "name")] - [Parameter (ParameterSetName = "filter")] - [ValidateSet('equal', 'contains')] + [Parameter (Mandatory = $false, ParameterSetName = "name")] + [Parameter (ParameterSetName = "filter_build")] + [ValidateSet('equal', 'notequal', 'contains', 'notcontains', 'less', 'lessorequal', 'greater', 'greaterorequal')] [string]$filter_type = "equal", - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [psobject]$filter_value, [Parameter(Mandatory = $false)] [switch]$skip, @@ -97,4 +94,4 @@ function Get-FGTFirewallIPPool { End { } -} \ No newline at end of file +} diff --git a/PowerFGT/Public/cmdb/firewall/policy.ps1 b/PowerFGT/Public/cmdb/firewall/policy.ps1 index 0e1a486a..a877d5c9 100644 --- a/PowerFGT/Public/cmdb/firewall/policy.ps1 +++ b/PowerFGT/Public/cmdb/firewall/policy.ps1 @@ -352,18 +352,15 @@ function Get-FGTFirewallPolicy { [string]$uuid, [Parameter (Mandatory = $false, ParameterSetName = "policyid")] [string]$policyid, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [string]$filter_attribute, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "name")] + [Parameter (Mandatory = $false, ParameterSetName = "name")] [Parameter (ParameterSetName = "uuid")] [Parameter (ParameterSetName = "policyid")] - [Parameter (ParameterSetName = "filter")] - [ValidateSet('equal', 'contains')] + [Parameter (ParameterSetName = "filter_build")] + [ValidateSet('equal', 'notequal', 'contains', 'notcontains', 'less', 'lessorequal', 'greater', 'greaterorequal')] [string]$filter_type = "equal", - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [psobject]$filter_value, [Parameter(Mandatory = $false)] [switch]$skip, @@ -580,4 +577,4 @@ function Remove-FGTFirewallPolicyMember { End { } -} \ No newline at end of file +} diff --git a/PowerFGT/Public/cmdb/firewall/vip.ps1 b/PowerFGT/Public/cmdb/firewall/vip.ps1 index d49b1470..8926368d 100644 --- a/PowerFGT/Public/cmdb/firewall/vip.ps1 +++ b/PowerFGT/Public/cmdb/firewall/vip.ps1 @@ -177,17 +177,14 @@ function Get-FGTFirewallVip { [string]$name, [Parameter (Mandatory = $false, ParameterSetName = "uuid")] [string]$uuid, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [string]$filter_attribute, - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "name")] + [Parameter (Mandatory = $false, ParameterSetName = "name")] [Parameter (ParameterSetName = "uuid")] - [Parameter (ParameterSetName = "filter")] - [ValidateSet('equal', 'contains')] + [Parameter (ParameterSetName = "filter_build")] + [ValidateSet('equal', 'notequal', 'contains', 'notcontains', 'less', 'lessorequal', 'greater', 'greaterorequal')] [string]$filter_type = "equal", - [Parameter (Mandatory = $false)] - [Parameter (ParameterSetName = "filter")] + [Parameter (Mandatory = $false, ParameterSetName = "filter_build")] [psobject]$filter_value, [Parameter(Mandatory = $false)] [switch]$skip, @@ -305,4 +302,4 @@ function Remove-FGTFirewallVip { End { } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 9f07b874..c259d39d 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,6 @@ For `Invoke-FGTRestMethod` and `Get-XXX` cmdlet like `Get-FGTFirewallAddress`, ... ``` -Actually, support only `equal` and `contains` filter type ### Address Group