Closed Sk83r closed 5 years ago
Hi @Sk83r
if you using this :
$rule | Set-NsxFirewallrule
the notes is updated ?
if you $rule have multiple rule inside, you can use also | Set-nsxFirewallRule
yes updated. Great!
How can I put into $rule array multiple rule IDs inside ?
I've tried Set-NsxFirewallRule with single id and -notes not a parameter in that command
get-nsxfirewallrule -ruleid xxx| Set-NsxFirewallRule -notes "mycomment"
Yes, there is no yet "notes" parameter but it can be easy to add...
After a quick check, what relase of NSX-V do you are using ? because there is no notes field but description from NSX-V API Guide
Ver. 6.4. 3
But also if you can describe how to push multiple rule ids inside $rule array and how should I point each time to different rule id when I use $rule.notes
you need to store on $rule variable multiple rule
if you try
$rules = get-nsxfirewallrule -id XX
$rules += get-nsxfirewallrule -id YY
$rules = get-nsxfirewallrule -id
$rules = get-nsxfirewallrule -ruleid XX
$rules += get-nsxfirewallrule -ruleid YY Method invocation failed because [System.Xml.XmlElement] does not contain a method named 'op_Addition'. At line:1 char:1
+ CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
yes updated. Great!
How can I put into $rule array multiple rule IDs inside ?
I've tried Set-NsxFirewallRule with single id and -notes not a parameter in that command
get-nsxfirewallrule -ruleid xxx| Set-NsxFirewallRule -notes "mycomment"
Any alternative to this one which not supported ?
I want to get entire rules in section (TEST) and set for all rules under it with updated notes
Something similar to this one below :
Get-NsxFirewallSection TEST| Get-NsxFirewallRule | Set-NsxFirewallRule -notes "mycomment"
Need to add -notes parameter to Set-NsxFirewallRule
I will look later
Hey Alexis
Really need it please 🙏 I also noticed I can't set notes using var ($rule fo instance) if ruleid never had note before.
Means it's only possible to update existing notes in rules but not to set new ones.
Need to modified Set-NsxFirewallRule, i will try to look this week end
Have you had the chance to look into it?
Yes, i need to finish test...
@Sk83r do you have try ? (it is available on last release of powernsx)
Yes. Works like a charm! Exactly what I needed.
Appriciate your assistance, Alexis
Hi guys
Is there any way to change notes (comments) in DFW rules ?
$rule = get-nsxfirewallrule -ruleid xxx $rule.notes = "my comment"
How should I publish it now ?
Is there any PS script for bulk use per range of IDs or Section ? would be very handy
Thanks