Get-FirewallRules

Returns the computer's list of firewall rules.

Syntax

Get-FirewallRules [<CommonParameters>]

Description

Sends objects down the pipeline for each of the firewall's rules. Each object contains the following properties:

This data is parsed from the output of:

netsh advfirewall firewall show rule name=all.

If the firewall isn't configurable, writes an error and returns without returning any objects.

Related Commands

EXAMPLE 1

Get-FirewallRules

Here's a sample of the output:

EdgeTraversal : Defer to application
Grouping      : Remote Assistance
Action        : Allow
RemotePort    : Any
RemoteIP      : Any
LocalIP       : Any
Name          : Remote Assistance (PNRP-In)
Direction     : In
Profiles      : Domain,Private
LocalPort     : 3540
Protocol      : UDP
Enabled       : True

EdgeTraversal : No
Grouping      : Remote Assistance
Action        : Allow
RemotePort    : Any
RemoteIP      : Any
LocalIP       : Any
Name          : Remote Assistance (PNRP-Out)
Direction     : Out
Profiles      : Domain,Private
LocalPort     : Any
Protocol      : UDP
Enabled       : True