< Back
Get-AzureRmVirtualNetworkSubnetConfig
Post
NAME Get-AzureRmVirtualNetworkSubnetConfig
SYNOPSIS
Gets a subnet in a virtual network.
SYNTAX
Get-AzureRmVirtualNetworkSubnetConfig [-DefaultProfile <IAzureContextContainer>] [-Name <String>] -VirtualNetwork <PSVirtualNetwork>
[<CommonParameters>]
DESCRIPTION
The Get-AzureRmVirtualNetworkSubnetConfig cmdlet gets one or more subnet configurations in an Azure virtual network.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Name <String>
Specifies the name of the subnet configuration that this cmdlet gets.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VirtualNetwork <PSVirtualNetwork>
Specifies the VirtualNetwork object that contains the subnet configuration that this cmdlet gets.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByValue)
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
PSVirtualNetwork
Parameter 'VirtualNetwork' accepts value of type 'PSVirtualNetwork' from the pipeline
OUTPUTS
Microsoft.Azure.Commands.Network.Models.PSSubnet
NOTES
1: Get a subnet in a virtual network
New-AzureRmResourceGroup -Name TestResourceGroup -Location centralus
$frontendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet
-AddressPrefix "10.0.1.0/24"
$virtualNetwork = New-AzureRmVirtualNetwork -Name MyVirtualNetwork -ResourceGroupName
TestResourceGroup -Location centralus -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet
Get-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -VirtualNetwork $virtualNetwork
This example creates a resource group and a virtual network with a single subnet in that resource group. It then retrieves data about that subnet.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... bnetconfig
Add-AzureRmVirtualNetworkSubnetConfig
New-AzureRmVirtualNetworkSubnetConfig
Remove-AzureRmVirtualNetworkSubnetConfig
Set-AzureRmVirtualNetworkSubnetConfig
SYNOPSIS
Gets a subnet in a virtual network.
SYNTAX
Get-AzureRmVirtualNetworkSubnetConfig [-DefaultProfile <IAzureContextContainer>] [-Name <String>] -VirtualNetwork <PSVirtualNetwork>
[<CommonParameters>]
DESCRIPTION
The Get-AzureRmVirtualNetworkSubnetConfig cmdlet gets one or more subnet configurations in an Azure virtual network.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Name <String>
Specifies the name of the subnet configuration that this cmdlet gets.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VirtualNetwork <PSVirtualNetwork>
Specifies the VirtualNetwork object that contains the subnet configuration that this cmdlet gets.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByValue)
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
PSVirtualNetwork
Parameter 'VirtualNetwork' accepts value of type 'PSVirtualNetwork' from the pipeline
OUTPUTS
Microsoft.Azure.Commands.Network.Models.PSSubnet
NOTES
1: Get a subnet in a virtual network
New-AzureRmResourceGroup -Name TestResourceGroup -Location centralus
$frontendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet
-AddressPrefix "10.0.1.0/24"
$virtualNetwork = New-AzureRmVirtualNetwork -Name MyVirtualNetwork -ResourceGroupName
TestResourceGroup -Location centralus -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet
Get-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -VirtualNetwork $virtualNetwork
This example creates a resource group and a virtual network with a single subnet in that resource group. It then retrieves data about that subnet.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... bnetconfig
Add-AzureRmVirtualNetworkSubnetConfig
New-AzureRmVirtualNetworkSubnetConfig
Remove-AzureRmVirtualNetworkSubnetConfig
Set-AzureRmVirtualNetworkSubnetConfig