Get-AzVirtualNetworkSubnetConfig
Gets a subnet in a virtual network.
Syntax
Get-AzVirtualNetworkSubnetConfig
[-Name <String>]
-VirtualNetwork <PSVirtualNetwork>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzVirtualNetworkSubnetConfig
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzVirtualNetworkSubnetConfig cmdlet gets one or more subnet configurations in an Azure virtual network.
Examples
Example 1: Get a subnet in a virtual network
New-AzResourceGroup -Name TestResourceGroup -Location centralus
$frontendSubnet = New-AzVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24"
$virtualNetwork = New-AzVirtualNetwork -Name MyVirtualNetwork -ResourceGroupName TestResourceGroup -Location centralus -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet
Get-AzVirtualNetworkSubnetConfig -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.
Parameters
-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 |
-Name
Specifies the name of the subnet configuration that this cmdlet gets.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceId
Specifies the resource id of the subnet that this cmdlet gets.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VirtualNetwork
Specifies the VirtualNetwork object that contains the subnet configuration that this cmdlet gets.
Type: | PSVirtualNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Outputs
Related Links
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure PowerShell