你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzRouteTable
获取路由表。
语法
Get-AzRouteTable
[-ResourceGroupName <String>]
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRouteTable
-ResourceGroupName <String>
-Name <String>
-ExpandResource <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
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 |