Skip to content

Function Firewall

Mark Wragg edited this page Jun 17, 2019 · 1 revision

Firewall

SYNOPSIS

Test firewall rule settings.

DESCRIPTION

Use to determine if the specified firewall rule has the desired setting.

PARAMETERS

Target [String]

The name of the firewall rule to be tested, as matched via DisplayName property.

[Parameter(Mandatory, Position=1, ParameterSetName="Default")]
[Parameter(Mandatory, Position=1, ParameterSetName="Property")]
[Alias("Path")]

Property [String]

The name of the property of the firewall rule to be tested.

[Parameter(Position=2, ParameterSetName="Property")]

Should [ScriptBlock]

A Script Block defining a Pester Assertion.

[Parameter(Mandatory, Position=2, ParameterSetName="Default")]
[Parameter(Mandatory, Position=3, ParameterSetName="Property")]

Assertions

Assertions: -Be

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

Firewall putty.exe Enabled { Should -Be "$True" }

-------------------------- EXAMPLE 2 --------------------------

Firewall putty.exe Action { Should -Be 'Allow' }

-------------------------- EXAMPLE 3 --------------------------

Firewall putty.exe Private { Should -Be 'Public' }