Bewerken

Delen via


New-AzPublicIpPrefix

Creates a Public IP Prefix

Syntax

New-AzPublicIpPrefix
   -Name <String>
   -ResourceGroupName <String>
   -Location <String>
   [-Sku <String>]
   [-Tier <String>]
   -PrefixLength <UInt16>
   [-IpAddressVersion <String>]
   [-IpTag <PSPublicIpPrefixTag[]>]
   [-Zone <String[]>]
   [-CustomIpPrefix <PSCustomIpPrefix>]
   [-EdgeZone <String>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzPublicIpPrefix cmdlet creates a public IP prefix.

Examples

Example 1: Create a new public Ip prefix

$publicIpPrefix = New-AzPublicIpPrefix -Name $prefixName -ResourceGroupName $rgName -PrefixLength 30

This command creates a new public IP prefix resource.

Example 2: Create a new global public Ip prefix

$publicIpPrefix = New-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname -location $location -Tier Global -PrefixLength 30

This command creates a new global public IP prefix resource.

Example 3

Creates a Public IP Prefix. (autogenerated)

New-AzPublicIpPrefix -CustomIpPrefix <PSCustomIpPrefix> -Location 'West US' -Name 'MyPublicIPPrefix' -PrefixLength '31' -ResourceGroupName 'MyResourceGroup'

Parameters

-AsJob

Run cmdlet in the background

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomIpPrefix

The CustomIpPrefix that this PublicIpPrefix will be associated with

Type:PSCustomIpPrefix
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EdgeZone

The edge zone of the public IP prefix

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

-Force

Do not ask for confirmation if you want to overwrite a resource

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

-IpAddressVersion

The public IP address version.

Type:String
Accepted values:IPv4, IPv6
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-IpTag

IpTag List.

Type:PSPublicIpPrefixTag[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Location

The public IP prefix location.

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

-Name

The resource name.

Type:String
Aliases:ResourceName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PrefixLength

The PublicIPPrefix length

Type:UInt16
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

The resource group name.

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

-Sku

The public IP Prefix Sku name.

Type:String
Accepted values:Standard
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

A hashtable which represents resource tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tier

The public IP Prefix Sku tier.

Type:String
Accepted values:Regional, Global
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Zone

A list of availability zones denoting the IP allocated for the resource needs to come from.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

UInt16

PSPublicIpPrefixTag[]

String[]

Hashtable

Outputs

PSPublicIpPrefix