Get-AzVirtualNetwork
Gets a virtual network in a resource group.
Syntax
Get-AzVirtualNetwork
[-Name <String>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzVirtualNetwork
-Name <String>
-ResourceGroupName <String>
-ExpandResource <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzVirtualNetwork cmdlet gets one or more virtual networks in a resource group.
Examples
Example 1: Retrieve a virtual network
Get-AzVirtualNetwork -Name MyVirtualNetwork -ResourceGroupName TestResourceGroup
Name : MyVirtualNetwork1
ResourceGroupName : TestResourceGroup
Location : eastus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup
/providers/Microsoft.Network/virtualNetworks/MyVirtualNetwork1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
AddressSpace : {
"AddressPrefixes": [
"xx.x.x.x/x"
]
}
DhcpOptions : {}
FlowTimeoutInMinutes : null
Subnets : []
VirtualNetworkPeerings : []
EnableDdosProtection : false
DdosProtectionPlan : null
This command gets the virtual network named MyVirtualNetwork in the resource group TestResourceGroup
Example 2: List virtual networks using filter
Get-AzVirtualNetwork -Name MyVirtualNetwork*
Name : MyVirtualNetwork1
ResourceGroupName : TestResourceGroup
Location : eastus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup
/providers/Microsoft.Network/virtualNetworks/MyVirtualNetwork1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
AddressSpace : {
"AddressPrefixes": [
"xx.x.x.x/x"
]
}
DhcpOptions : {}
FlowTimeoutInMinutes : null
Subnets : []
VirtualNetworkPeerings : []
EnableDdosProtection : false
DdosProtectionPlan : null
This command gets all virtual networks that start with "MyVirtualNetwork".
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 |
-ExpandResource
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of the virtual network that this cmdlet gets.
Type: | String |
Aliases: | ResourceName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | True |
-ResourceGroupName
Specifies the name of the resource group that virtual network belongs to.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | True |
Inputs
Outputs
Related Links
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure PowerShell