你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Remove-AzExpressRouteGateway

Remove-AzExpressRouteGateway cmdlet 删除 Azure ExpressRoute 网关。 这是特定于 Azure 虚拟 WAN 软件定义的连接的网关。

语法

Remove-AzExpressRouteGateway
      -ResourceGroupName <String>
      -Name <String>
      [-PassThru]
      [-Force]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzExpressRouteGateway
      -InputObject <PSExpressRouteGateway>
      [-PassThru]
      [-Force]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzExpressRouteGateway
      -ResourceId <String>
      [-PassThru]
      [-Force]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

说明

Remove-AzExpressRouteGateway cmdlet 删除 Azure ExpressRoute 网关。 这是特定于 Azure 虚拟 WAN 软件定义的连接的网关。

示例

示例 1

New-AzResourceGroup -Location "West Central US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West Central US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
Remove-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -Passthru

此示例在美国中部创建资源组、虚拟 WAN、虚拟中心、可缩放的 ExpressRoute 网关,然后立即将其删除。 若要在删除虚拟网关时取消提示,请使用 -Force 标志。 这会删除 ExpressRouteGateway 和附加到它的所有 ExpressRoute连接ion。

示例 2

New-AzResourceGroup -Location "West Central US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West Central US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" | Remove-AzExpressRouteGateway -Passthru

此示例在美国中西部创建资源组、虚拟 WAN、虚拟中心、可缩放的 ExpressRoute 网关,然后立即将其删除。 此删除操作使用 powershell 管道进行,后者使用 Get-AzExpressRouteGateway 命令返回的 ExpressRouteGateway 对象。 若要在删除虚拟网关时取消提示,请使用 -Force 标志。 这会删除 ExpressRouteGateway 和附加到它的所有 ExpressRoute连接ion。

参数

-Confirm

提示你在运行 cmdlet 之前进行确认。

类型:SwitchParameter
别名:cf
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:IAzureContextContainer
别名:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Force

不要要求确认。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-InputObject

要删除的 ExpressRouteGateway 对象。

类型:PSExpressRouteGateway
别名:ExpressRouteGateway
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-Name

ExpressRouteGateway 名称。

类型:String
别名:ResourceName, ExpressRouteGatewayName
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-PassThru

返回一个代表你所处理的项目的对象。 默认情况下,此 cmdlet 将不产生任何输出。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-ResourceGroupName

资源组名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-ResourceId

要删除的 ExpressRouteGateway 的 Azure 资源 ID。

类型:String
别名:expressRouteGatewayId
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-WhatIf

显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。

类型:SwitchParameter
别名:wi
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

PSExpressRouteGateway

String

输出

Boolean