< Back

Set-AzureSubnet

Wed Jan 30, 2019 5:54 pm

NAME Set-AzureSubnet



SYNOPSIS

Defines the subnet list for an Azure virtual machine.





SYNTAX

Set-AzureSubnet [-SubnetNames] <String[]> -VM <IPersistentVM> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable

<String>] [<CommonParameters>]





DESCRIPTION

The Set-AzureSubnet cmdlet sets the subnet list for a virtual machine configuration. Use with New-AzureVM to set the subnets for a virtual machine.





PARAMETERS

-SubnetNames <String[]>

Specifies an array that contains the list of subnet names.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VM <IPersistentVM>

Specifies the virtual machine object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Add a subnet to a virtual machine configuration --------------------------



PS C:\\>New-AzureVMConfig -Name "VirtualMachine04" -ImageName $image -InstanceSize "Small" | Add-AzureProvisioningConfig -Windows -Password "password" |

Set-AzureSubnet "PubSubnet","PrivSubnet" | New-AzureVM -ServiceName "ContosoService03"



This command adds a subnet to the virtual machine configuration, and then creates the virtual machine named VirtualMachine04.



RELATED LINKS

Get-AzureVM

New-AzureVM

Update-AzureVM