vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 89 forks source link

Update a Firewall Rule "Applied to"? #532

Open MarcelMertens opened 6 years ago

MarcelMertens commented 6 years ago

Hello, i'm looking for a way to update existing firewall rules which are applied to a selection of Edge Gateways. I'd like to add more Edge Gateways to the "Applied To" section of the existing rule, but AFAIK there is no cmd avaiable for this. "Add-NsxFireRuleMember" only supports Source/Destination.

Kind regards,

Marcel

alagoutte commented 6 years ago

Hi Marcel,

Yes, there is not (yet) cmdlet for update a Firewall Rule There is a PR (#506) waiting for modified some Firewall Rule but not Applied To

I think, you can try to use it like : $rule = Get-NsxFirewallRule -Ruleid 1007 $rule.appliedToList.appliedTo = ... <- need to add your AppliedTo (May need to use some internal function like New-NsxAppliedToListNode)

and after update rule $rule | Set-NsxFirewallRule

MarcelMertens commented 6 years ago

Set-NsxFirewallRule don't have that... ??

alagoutte commented 6 years ago

You need to look PR #506

alagoutte commented 5 years ago

hi @MarcelMertens

Set-NsxFirewallRule is now available with build 1125