Test-​Azure​Rm​Private​IP​Address​Availability

Test availability of a private IP address in a virtual network.

Syntax

Test-AzureRmPrivateIPAddressAvailability
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    -IPAddress <String>
    -ResourceGroupName <String>
    -VirtualNetworkName <String>
    [<CommonParameters>]
Test-AzureRmPrivateIPAddressAvailability
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    -IPAddress <String>
    -VirtualNetwork <PSVirtualNetwork>
    [<CommonParameters>]

Description

The Test-AzureRmPrivateIPAddressAvailability cmdlet tests whether a specified private IP address is available in a virtual network. This cmdlet returns a list of available private IP addresses if the requested private IP address is taken.

Examples

Example 1: Test whether an IP address is available using the pipeline

PS C:\>Get-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName $rgname | Test-AzureRmPrivateIPAddressAvailability -IPAddress "10.0.1.10"

This command gets a virtual network and uses the pipeline operator to pass it to Test-AzureRmPrivateIPAddressAvailability, which tests whether the specified private IP address is available.

Required Parameters

-IPAddress

Specifies the IP address to test.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group for the virtual network.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VirtualNetwork

Specifies a PSVirtualNetwork object.

Type:PSVirtualNetwork
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VirtualNetworkName

Specifies the name of the virtual network.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False