Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added VIPGRP functions matching *-AddressGroup* #89

Merged
merged 24 commits into from
Oct 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update vipgroup.ps1
  • Loading branch information
poundy authored and alagoutte committed Sep 22, 2020
commit b49d7a90d08fedb57eca0f2504850b14ad83bcc7
14 changes: 7 additions & 7 deletions PowerFGT/Public/cmdb/firewall/vipgroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ function Add-FGTFirewallVipGroup {
.EXAMPLE
Add-FGTFirewallVipGroup -name MyVipGroup -member MyVip1 -interface wan1

Add VIP Group with member MyVip1 associated to interface wan1
Add VIP Group with member MyVip1, associated to interface wan1

.EXAMPLE
Add-FGTFirewallVipGroup -name MyVipGroup -member MyVip1, MyVip2 -interface wan1

Add VIP Group with members MyVip1 and MyVip2 associated to interface wan1
Add VIP Group with members MyVip1 and MyVip2, associated to interface wan1

.EXAMPLE
Add-FGTFirewallVipGroup -name MyVipGroup -member MyVip1 -comment "My Address Group" -interface wan1
Add-FGTFirewallVipGroup -name MyVipGroup -member MyVip1 -comment "My VIP Group" -interface wan1

Add VIP Group with member MyVip1 and a comment associated to interface wan1
Add VIP Group with member MyVip1 and a comment, associated to interface wan1
#>

Param(
Expand Down Expand Up @@ -154,7 +154,7 @@ function Add-FGTFirewallVipGroupMember {
$_vipgrp = new-Object -TypeName PSObject

if ( $PsBoundParameters.ContainsKey('member') ) {
#Add member to existing addrgrp member
#Add member to existing vipgrp member
$members = $vipgrp.member
foreach ( $m in $member ) {
$member_name = @{ }
Expand Down Expand Up @@ -461,7 +461,7 @@ function Remove-FGTFirewallVipGroup {
$MyFGTVipGroup = Get-FGTFirewallVipGroup -name MyFGTVipGroup
PS C:\>$MyFGTVipGroup | Remove-FGTFirewallVipGroup -noconfirm

Remove address object MyFGTAddressGroup with no confirmation
Remove VIP Group object MyFGTVipGroup with no confirmation

#>

Expand Down Expand Up @@ -574,7 +574,7 @@ function Remove-FGTFirewallVipGroupMember {
$members = $members | Where-Object { $_.name -ne $remove_member }
}

#check if there is always a member... (it is not possible don't have member on Address Group)
#check if there is always a member... (it is not possible to have an empty member list on VIP Group)
if ( $members.count -eq 0 ) {
Throw "You can't remove all members. Use Remove-FGTFirewallVipGroup to remove VIP Group"
}
Expand Down