Skip to content

Function TcpPort

Mark Wragg edited this page Jun 17, 2019 · 2 revisions

TcpPort

SYNOPSIS

Test a a Tcp Port.

DESCRIPTION

Test that a Tcp Port is listening and optionally validate any TestNetConnectionResult property.

PARAMETERS

Target [String]

[Parameter(
  Mandatory = $true,
  Position = 2,
  ParameterSetName = 'Set 1')]

Qualifier [String]

[Parameter(
  Mandatory = $true,
  Position = 3,
  ParameterSetName = 'Set 1')]

Property [String]

[Parameter(
  Mandatory = $true,
  Position = 4,
  ParameterSetName = 'Set 1')]

Should [ScriptBlock]

[Parameter(
  Mandatory = $true,
  Position = 5,
  ParameterSetName = 'Set 1')]

Assertions

Be, BeExactly, Match, MatchExactly

EXAMPLES

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

TcpPort localhost 80 PingSucceeded  { Should Be $true }

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

TcpPort localhost 80 TcpTestSucceeded { Should Be $true }