Hi everybody,
again a short note for my self to not search again in my offline notes. 😉
How to dump Firewall rules with Powershell 3.0 and newer in a file “oneliner”.
Inbound rules:
1 2 |
New-Item c:\temp\ -Type directory Get-NetFirewallRule | Where { $_.Enabled –eq ‘True’ –and $_.Direction –eq ‘Inbound’ } | Out-File -Encoding utf8 C:\temp\inbound.txt |
Outbound rules:
1 2 |
New-Item c:\temp\ -Type directory Get-NetFirewallRule | Where { $_.Enabled –eq ‘True’ –and $_.Direction –eq ‘Outbound’ } | Out-File -Encoding utf8 C:\temp\outbound.txt |