Get-AzVHubEffectiveRoute
Retrieves the effective routes of a virtual hub resource
Syntax
ByVirtualHubName (Default)
Get-AzVHubEffectiveRoute
-ResourceGroupName <String>
-VirtualHubName <String>
[-ResourceId <String>]
[-VirtualWanResourceType <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByVirtualHubObject
Get-AzVHubEffectiveRoute
-VirtualHubObject <PSVirtualHub>
[-ResourceId <String>]
[-VirtualWanResourceType <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByVirtualHubResourceId
Get-AzVHubEffectiveRoute
-VirtualHubResourceId <String>
[-ResourceId <String>]
[-VirtualWanResourceType <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Gets the effective routes of the given virtual hub resource
Examples
Example 1
New-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan" -Location "westcentralus" -VirtualWANType "Standard" -AllowVnetToVnetTraffic -AllowBranchToBranchTraffic
$virtualWan = Get-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan"
New-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub" -Location "westcentralus" -AddressPrefix "10.0.0.0/16" -VirtualWan $virtualWan
$virtualHub = Get-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub"
$hubRouteTableId = "/subscriptions/eb40168c-f355-4a18-b13c-5d9751d314c6/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/defaultRouteTable"
Get-AzVHubEffectiveRoute -VirtualHubObject $virtualHub -ResourceId $hubRouteTableId -VirtualWanResourceType "RouteTable"
Value : [
{
"AddressPrefixes": [
"10.2.0.0/16"
],
"NextHops": [
"/subscriptions/eb40168c-f355-4a18-b13c-5d9751d314c6/resourceGroups/testRg/providers/Microsoft.Network/virtu
alHubs/testHub/hubVirtualNetworkConnections/testConnection"
],
"NextHopType": "Virtual Network Connection",
"RouteOrigin": "/subscriptions/eb40168c-f355-4a18-b13c-5d9751d314c6/resourceGroups/testRg/providers/Microsoft.
Network/virtualHubs/testHub/hubVirtualNetworkConnections/testConnection"
}
]
This command gets the effective routes of the virtual hub default route table.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The resource group name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByVirtualHubName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceId
The resource id of a virtual wan resource.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VirtualHubName
The virtual hub resource name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ParentVirtualHubName, ParentResourceName
Parameter sets
ByVirtualHubName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VirtualHubObject
The parent resource.
Parameter properties
Type: PSVirtualHub
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ParentObject, ParentVirtualHub
Parameter sets
ByVirtualHubObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-VirtualHubResourceId
The virtual hub resource id.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: VirtualHubId, ParentVirtualHubId
Parameter sets
ByVirtualHubResourceId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-VirtualWanResourceType
The virtual wan resource type.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs