Get-AzRouteTable
取得路由表。
語法
Get-AzRouteTable
[-ResourceGroupName <String>]
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRouteTable
-ResourceGroupName <String>
-Name <String>
-ExpandResource <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzRouteTable Cmdlet 會取得 Azure 路由表。 您可以取得單一路由表,或取得資源群組或訂用帳戶中的所有路由表。
範例
範例 1:取得路由表
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 : []
此命令會取得名為 ResourceGroup11 的資源群組中名為 RouteTable01 的路由表。
範例 2:使用篩選列出路由表
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 : []
此命令會取得名稱開頭為 「RouteTable」 的所有路由表
參數
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ExpandResource
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Name
指定此 Cmdlet 取得的路由表名稱。
類型: | String |
別名: | ResourceName |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |
-ResourceGroupName
指定包含此 Cmdlet 取得之路由表的資源群組名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |