Skip to content

Commit

Permalink
VIPGroup(Firewall): Add -meta parameter (with Tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Oct 1, 2023
1 parent 02b2e1f commit 705f29c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PowerFGT/Public/cmdb/firewall/vipgroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ function Get-FGTFirewallVipGroup {
Get VIP Group with uuid 9e73a10e-1772-51ea-a8d7-297686fd7702
.EXAMPLE
Get-FGTFirewallVipGroup -meta
Get list of all nat vip groups with metadata (q_...) like usage (q_ref)
.EXAMPLE
Get-FGTFirewallVipGroup -skip
Expand Down Expand Up @@ -273,6 +278,8 @@ function Get-FGTFirewallVipGroup {
[Parameter (ParameterSetName = "filter")]
[psobject]$filter_value,
[Parameter(Mandatory = $false)]
[switch]$meta,
[Parameter(Mandatory = $false)]
[switch]$skip,
[Parameter(Mandatory = $false)]
[String[]]$vdom,
Expand All @@ -286,6 +293,9 @@ function Get-FGTFirewallVipGroup {
Process {

$invokeParams = @{ }
if ( $PsBoundParameters.ContainsKey('meta') ) {
$invokeParams.add( 'meta', $meta )
}
if ( $PsBoundParameters.ContainsKey('skip') ) {
$invokeParams.add( 'skip', $skip )
}
Expand Down
15 changes: 15 additions & 0 deletions Tests/integration/FirewallVipGroup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ Describe "Get Firewall Vip Group" {
Confirm-FGTVipGroup ($vipgroup) | Should -Be $true
}

It "Get Vip Group ($pester_vipgroup1) and meta" {
$vipgroup = Get-FGTFirewallVipGroup -name $pester_vipgroup1 -meta
$vipgroup.name | Should -Be $pester_vipgroup1
$vipgroup.q_ref | Should -Not -BeNullOrEmpty
$vipgroup.q_static | Should -Not -BeNullOrEmpty
$vipgroup.q_no_rename | Should -Not -BeNullOrEmpty
$vipgroup.q_global_entry | Should -Not -BeNullOrEmpty
$vipgroup.q_type | Should -Be '206'
$vipgroup.q_path | Should -Be "firewall"
$vipgroup.q_name | Should -Be "vipgrp"
$vipgroup.q_mkey_type | Should -Be "string"
$vipgroup.q_no_edit | Should -Not -BeNullOrEmpty
$vipgroup.q_class | Should -Not -BeNullOrEmpty
}

Context "Search" {

It "Search Vip Group by name ($pester_vipgroup1)" {
Expand Down

0 comments on commit 705f29c

Please sign in to comment.