Test-IPAddress

Tests that an IP address is in use on the local computer.

Syntax

Test-IPAddress [-IPAddress] <IPAddress> [<CommonParameters>]

Description

Sometimes its useful to know if an IP address is being used on the local computer. This function does just that.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
IPAddress IPAddress

The IP address to check.

true false

EXAMPLE 1

Test-IPAddress -IPAddress '10.1.2.3'

Returns true if the IP address 10.1.2.3 is being used on the local computer.

EXAMPLE 2

Test-IPAddress -IPAddress '::1'

Demonstrates that you can use IPv6 addresses.

EXAMPLE 3

Test-IPAddress -IPAddress ([Net.IPAddress]::Parse('10.5.6.7'))

Demonstrates that you can use real System.Net.IPAddress objects.