New-​WA​Pack​VM​Subnet

Creates a virtual machine subnet.

Syntax

New-WAPackVMSubnet
   -Name <String>
   [-Profile <AzureSMProfile>]
   -Subnet <String>
   -VNet <VMNetwork>
   [<CommonParameters>]

Description

The New-WAPackVMSubnet cmdlet creates a virtual machine subnet.

Examples

Example 1: Create a virtual machine subnet

PS C:\> $VNet = Get-WAPackVNet -Name "ContosoVNet01"
PS C:\> New-WAPackVMSubnet -VNet $VNet -Name "ContosoVMSubnet01" -Subnet "192.168.1.0/24"

The first command first retrieves the virtual machine network to which we want to add a new virtual machine subnet. This virtual machine network is named ContosoVNet01.

The second command creates a virtual machine subnet using the previously retrieve virtual machine network, a name ContosoVMSubnet01 and a subnet 192.168.1.0/24.

Required Parameters

-Name

Specifies a name for the virtual machine subnet.

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

Specifies a subnet for the virtual machine subnet.

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

Specifies a VNet associated with the virtual machine subnet.

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

Optional Parameters

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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