JAEN

PowerShell

Get-NetFirewallRule

CautionWindows Firewall rules

Get-NetFirewallRule -DisplayName '*remote*'

Queries/creates firewall rules (netsh advfirewall's successor) — the proper way to audit and open ports.

Examples

  • New-NetFirewallRule -DisplayName 'App 8080' -Direction Inbound -LocalPort 8080 -Protocol TCP -Action AllowOpen inbound 8080

Syntax

Get-NetFirewallRule [-Enabled True] / New-NetFirewallRule -DisplayName n -Direction Inbound -LocalPort p -Protocol TCP -Action Allow

Before you run it

Open only what's necessary.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store