Skip to content

Instantly share code, notes, and snippets.

@MarkZhangTW
Created June 20, 2020 03:35
Show Gist options
  • Save MarkZhangTW/7acf038cb025fce855e84562315f23f8 to your computer and use it in GitHub Desktop.
Save MarkZhangTW/7acf038cb025fce855e84562315f23f8 to your computer and use it in GitHub Desktop.
Get-NetFirewallRule |
Where-Object Direction -eq Inbound |
Format-Table -Property DisplayName, Enabled, Profile, Direction, Action, `
@{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}}, `
@{Name='LocalPort';Expression={($PSItem | Get-NetFirewallPortFilter).LocalPort}}, `
@{Name='RemotePort';Expression={($PSItem | Get-NetFirewallPortFilter).RemotePort}}, `
@{Name='IcmpType';Expression={($PSItem | Get-NetFirewallPortFilter).IcmpType}}, `
@{Name='DynamicTarget';Expression={($PSItem | Get-NetFirewallPortFilter).DynamicTarget}} `
-AutoSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment