Test Reserved IP
Last Modified: February 25, 2024 18:18 CEST

Test-ReservedIp #


This function checks whether a given IP address is a part of the reserved IP address ranges. The IP address must be passed as a string.


Test-ReservedIp [[-ip] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]


The Test-ReservedIP function is a utility that is designed to evaluate if an IP address belongs to the reserved IP address ranges, which include private networks, loopback addresses, and other specific ranges reserved for documentation and example code, network benchmark tests, IETF protocol assignments, etc.

The function checks whether the given IP address falls within any of the predefined IP ranges. If the address matches any of these ranges, the function returns true; otherwise, it returns false.

This function only checks if an IP address is within the reserved ranges. It does not perform any network operations using the IP address, such as pinging or opening a network connection.

The list of reserved IP ranges used by the function includes commonly known ranges such as private networks ( -, -, - and loopback addresses ( -, among others.

Please note that these ranges are as per the standards defined by the Internet Engineering Task Force (IETF) and the Internet Assigned Numbers Authority (IANA) as of the date of function creation.


Example 1: Tests if the ip is a reserved ip address #

PS C:\> Test-ReservedIP -ip ''

In the above example, the IP address ‘’ is a loopback address, and so it is part of the reserved IP ranges. Therefore, the function will return true.


-ip #

This parameter expects the IP address to be checked as a string.

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters #

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.


None #


System.Object #