Skip to content

Instantly share code, notes, and snippets.

@rleap-m
Last active December 7, 2020 20:25
Show Gist options
  • Save rleap-m/5d8158cfe11b3d123fbaef471ab8de0e to your computer and use it in GitHub Desktop.
Save rleap-m/5d8158cfe11b3d123fbaef471ab8de0e to your computer and use it in GitHub Desktop.
Docker Firewall Rules
Get-NetFirewallRule -DisplayName '*docker*' |
ForEach-Object { $ports = Get-NetFirewallPortFilter -AssociatedNetFirewallRule $_;
Select-Object -InputObject $_ -Property DisplayName,Enabled,Profile,Direction,Action,
@{Name='Protocol'; Expression={$ports.Protocol}},@{Name='LocalPort'; Expression={[int64]$ports.LocalPort}} } |
Sort-Object -Property LocalPort | Format-Table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment