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
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
Azure PowerShell