SYNOPSIS

Gets the public IP address.

SYNTAX

Get-AzPublicIpAddress-Name "<PublicIpAddressName>" [-ResourceGroupName "<ResourceGroupName>"] [-ResourceId "<ResourceId>"] [-Force] [-AsJob] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutBuffer <IBuffer>] [-OutVariable <Object>] [-PipelineVariable <String>] [-Verbose] [-Debug] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-Append] [-DisallowSingleInstance] Get-AzPublicIpAddress [-ResourceGroupName "<ResourceGroupName>"] [-Tag <Hashtable>] [-Location "<Location>"] [-ResourceGroupRegEx "<ResourceGroupRegEx>"] [-NameRegEx "<NameRegEx>"] [-Force] [-AsJob] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutBuffer <IBuffer>] [-OutVariable <Object>] [-PipelineVariable <String>] [-Verbose] [-Debug] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-Append] [-DisallowSingleInstance] Get-AzPublicIpAddress [-Tag <Hashtable>] [-Location "<Location>"] [-ResourceGroupRegEx "<ResourceGroupRegEx>"] [-NameRegEx "<NameRegEx>"] [-Force] [-AsJob] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutBuffer <IBuffer>] [-OutVariable <Object>] [-PipelineVariable <String>] [-Verbose] [-Debug] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-Append] [-DisallowSingleInstance]

DESCRIPTION

The Get-AzPublicIpAddress cmdlet gets a public IP address or a list of public IP addresses.

You can get a specific public IP address by specifying its name and resource group name. You can also get a list of all public IP addresses in the current subscription.

EXAMPLES

Example 1: Get a specific public IP address

This command gets the public IP address named "MyPublicIp" in the resource group "MyResourceGroup".

Get-AzPublicIpAddress -Name "MyPublicIp" -ResourceGroupName "MyResourceGroup"

Example 2: Get all public IP addresses in a subscription

This command gets all public IP addresses in the current Azure subscription.

Get-AzPublicIpAddress

Example 3: Get public IP addresses with a specific tag

This command gets all public IP addresses that have the tag "Environment" with the value "Production".

Get-AzPublicIpAddress -Tag @{"Environment"="Production"}

PARAMETERS

Name Type Description
-Name System.String Specifies the name of the public IP address.
-ResourceGroupName System.String Specifies the name of the resource group that contains the public IP address.
-ResourceId System.String The resource ID of the public IP address.
-Force System.Management.Automation.SwitchParameter Do not ask for confirmation.
-AsJob System.Management.Automation.SwitchParameter Run cmdlet in the background.
-Tag System.Collections.Hashtable Specifies tags associated with the public IP address.
-Location System.String Specifies the location of the public IP address.
-ResourceGroupRegEx System.String Regular expression to match resource group names.
-NameRegEx System.String Regular expression to match public IP address names.
-ErrorAction System.Management.Automation.ActionPreference

Turns on/off the error reporting for this cmdlet.

Valid values are: Continue, SilentlyContinue, Stop, Inquire, Wait, Suspend.

-ErrorVariable System.String When performing a cmdlet, it will cause an error and add it to the specified variable.
-OutBuffer System.Management.Automation.IBuffer Specifies how output is stored in the buffer.
-OutVariable System.String When performing a cmdlet, it will pass the results to the specified variable.
-PipelineVariable System.String When performing a cmdlet, it will pass the results to the specified variable.
-Verbose System.Management.Automation.SwitchParameter Turns on verbose output.
-Debug System.Management.Automation.SwitchParameter Turns on debug output.
-WarningAction System.Management.Automation.ActionPreference

Turns on/off the warning reporting for this cmdlet.

Valid values are: Continue, SilentlyContinue, Stop, Inquire, Wait, Suspend.

-WarningVariable System.String When performing a cmdlet, it will cause a warning and add it to the specified variable.
-Append System.Management.Automation.SwitchParameter Appends the output.
-DisallowSingleInstance System.Management.Automation.SwitchParameter Prevent instances of the cmdlet from running at the same time.

INPUTS

Microsoft.Azure.Commands.Network.Models.PSPublicIpAddress
System.String
System.Collections.Hashtable

OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSPublicIpAddress
Microsoft.Azure.Commands.Network.Models.PSPublicIpAddress[]

NOTES

This cmdlet is in the Microsoft.Azure.Commands.Network.dll. The Buy-AzPublicIpAddress cmdlet has been deprecated and removed. Use the New-AzPublicIpAddress cmdlet instead.

RELATED LINKS