Get-AzExpressRouteGateway
Gets a ExpressRouteGateway resource using ResourceGroupName and GatewayName OR lists all gateways by ResourceGroupName or SubscriptionId.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Get-AzExpressRouteGateway
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzExpressRouteGateway
[-ResourceGroupName <String>]
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzExpressRouteGateway
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Gets a ExpressRouteGateway resource using ResourceGroupName and GatewayName OR lists all gateways by ResourceGroupName or SubscriptionId.
Examples
Example 1
PS C:\> New-AzResourceGroup -Location "West Central US" -Name "testRG"
PS C:\> $virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West Central US"
PS C:\> $virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
PS C:\> New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
PS C:\> Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw"
ResourceGroupName : testRG
Name : testExpressRoutegw
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw
Location : West Central US
ExpressRouteGatewayScaleUnit : 2
VirtualHub : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub
BgpSettings : {}
Type : Microsoft.Network/ExpressRouteGateways
ProvisioningState : Succeeded
The above will create a resource group, Virtual WAN, Virtual Network, Virtual Hub in West Central US in "testRG" resource group in Azure. A ExpressRoute gateway will be created thereafter in the Virtual Hub with 2 scale units.
It then gets the ExpressRouteGateway using its resourceGroupName and the gateway name.
Example 2
PS C:\> Get-AzExpressRouteGateway -Name test*
ResourceGroupName : testRG
Name : testExpressRoutegw1
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw1
Location : West Central US
ExpressRouteGatewayScaleUnit : 2
VirtualHub : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub
BgpSettings : {}
Type : Microsoft.Network/ExpressRouteGateways
ProvisioningState : Succeeded
ResourceGroupName : testRG
Name : testExpressRoutegw2
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw2
Location : West Central US
ExpressRouteGatewayScaleUnit : 2
VirtualHub : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub
BgpSettings : {}
Type : Microsoft.Network/ExpressRouteGateways
ProvisioningState : Succeeded
This command will get all ExpressRouteGateways that start with "test"
Parameters
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The resource name.
| Type: | String |
| Aliases: | ResourceName, ExpressRouteGatewayName |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The resource group name.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The Azure resource ID for the expressRouteGateway to be deleted.
| Type: | String |
| Aliases: | expressRouteGatewayId |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |