Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Get-AzRouteTable

Gets route tables.

Syntax

NoExpand (Default)

Get-AzRouteTable
 [-ResourceGroupName <String>]
 [-Name <String>]
 [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

Expand

Get-AzRouteTable
 -ResourceGroupName <String>
 -Name <String>
 -ExpandResource <String>
 [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

Description

The Get-AzRouteTable cmdlet gets Azure route tables. You can get a single route table, or get all the route tables in a resource group or in your subscription.

Examples

Example 1: Get a route table

Get-AzRouteTable -ResourceGroupName "ResourceGroup11" -Name "RouteTable01"
Name : routetable01
ResourceGroupName : ResourceGroup11
Location : eastus
Id : /subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Microsoft.Networ
 k/routeTables/routetable01
Etag : W/"db5f4e12-3f34-465b-92dd-0ab3bf6fc274"
ProvisioningState : Succeeded
Tags :
Routes : [
 {
 "Name": "route07",
 "Etag": "W/\"db5f4e12-3f34-465b-92dd-0ab3bf6fc274\"",
 "Id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Micro
 soft.Network/routeTables/routetable01/routes/route07",
 "AddressPrefix": "10.1.0.0/16",
 "NextHopType": "VnetLocal",
 "NextHopIpAddress": null,
 "ProvisioningState": "Succeeded"
 }
 ]
Subnets : []

This command gets the route table named RouteTable01 in the resource group named ResourceGroup11.

Example 2: List route tables using filtering

Get-AzRouteTable -Name RouteTable*
Name : routetable01
ResourceGroupName : ResourceGroup11
Location : eastus
Id : /subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Microsoft.Networ
 k/routeTables/routetable01
Etag : W/"db5f4e12-3f34-465b-92dd-0ab3bf6fc274"
ProvisioningState : Succeeded
Tags :
Routes : [
 {
 "Name": "route07",
 "Etag": "W/\"db5f4e12-3f34-465b-92dd-0ab3bf6fc274\"",
 "Id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Micro
 soft.Network/routeTables/routetable01/routes/route07",
 "AddressPrefix": "10.1.0.0/16",
 "NextHopType": "VnetLocal",
 "NextHopIpAddress": null,
 "ProvisioningState": "Succeeded"
 }
 ]
Subnets : []

Name : routetable02
ResourceGroupName : ResourceGroup11
Location : eastus
Id : /subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Microsoft.Networ
 k/routeTables/routetable02
Etag : W/"db5f4e12-3f34-465b-92dd-0ab3bf6fc274"
ProvisioningState : Succeeded
Tags :
Routes : [
 {
 "Name": "route07",
 "Etag": "W/\"db5f4e12-3f34-465b-92dd-0ab3bf6fc274\"",
 "Id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Micro
 soft.Network/routeTables/routetable02/routes/route07",
 "AddressPrefix": "10.1.0.0/16",
 "NextHopType": "VnetLocal",
 "NextHopIpAddress": null,
 "ProvisioningState": "Succeeded"
 }
 ]
Subnets : []

This command gets all route tables whose name starts with "RouteTable"

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

-ExpandResource

The Get-AzRouteTable cmdlet gets Azure route tables. You can get a single route table, or get all the route tables in a resource group or in your subscription.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

Specifies the name of the route table that this cmdlet gets.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:ResourceName

Parameter sets

-ResourceGroupName

Specifies the name of the resource group that contains the route tables that this cmdlet gets.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

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.

Inputs

String

Outputs

PSRouteTable

Related Links


Feedback

Was this page helpful?