< Back

Get-AzureSubnet

Wed Jan 30, 2019 5:46 pm

NAME Get-AzureSubnet



SYNOPSIS

Gets a list of subnets associated with the specified Azure virtual machine.





SYNTAX

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

[<CommonParameters>]





DESCRIPTION

The Get-AzureSubnet cmdlet returns a list the subnets associated with the specified virtual machine. Use Get-AzureVM to specify the virtual machine.





PARAMETERS

-VM <IPersistentVM>

Specifies the virtual machine object from which to get the subnet list.



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: Get subnets for a virtual machine --------------------------



PS C:\\>$VM = Get-AzureVM -ServiceName "ContosoService03" -Name "VirtualMachine01"

C:\\PS> Get-AzureSubnet -VM $VM



The first command gets a virtual machine named VirtualMachine01 in the service named ContosoService03, and then stores it in the $VM variable.



RELATED LINKS

Get-AzureVM

Set-AzureSubnet