Set-NetFirewallRule –DisplayName "[ルール名]" -Enabled True
Set-NetFirewallRule –DisplayName "[ルール名]" -Enabled False
Remove-NetFirewallRule –DisplayName "[ルール名]"
New-NetFirewallRule ` -Name 'ICMPv4' ` -DisplayName 'ICMPv4' ` -Description 'Allow ICMPv4' ` -Profile Any ` -Direction Inbound ` -Action Allow ` -Protocol ICMPv4 ` -Program Any ` -LocalAddress Any ` -RemoteAddress Any
Get-NetFirewallRule | Where-Object Name -Like 'ICMPv4' Name : ICMPv4 DisplayName : ICMPv4 Description : Allow ICMPv4 DisplayGroup : Group : Enabled : True Profile : Any Platform : {} Direction : Inbound Action : Allow EdgeTraversalPolicy : Block LooseSourceMapping : False LocalOnlyMapping : False Owner : PrimaryStatus : OK Status : The rule was parsed successfully from the store. (65536) EnforcementStatus : NotApplicable PolicyStoreSource : PersistentStore PolicyStoreSourceType : Local