共用方式為


Remove-AzExpressRouteGateway

Remove-AzExpressRouteGateway Cmdlet 會移除 Azure ExpressRoute 閘道。 這是 Azure 虛擬 WAN 軟體定義連線的特定閘道。

語法

ByExpressRouteGatewayName (預設值)

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

ByExpressRouteGatewayObject

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

ByExpressRouteGatewayResourceId

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

Description

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 和附加至它的所有 ExpressRouteConnections。

範例 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 和附加至它的所有 ExpressRouteConnections。

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False
別名:參閱

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

參數屬性

類型:IAzureContextContainer
預設值:None
支援萬用字元:False
不要顯示:False
別名:AzContext, AzureRmContext, AzureCredential

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Force

請勿要求確認。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-InputObject

要刪除的 ExpressRouteGateway 物件。

參數屬性

類型:PSExpressRouteGateway
預設值:None
支援萬用字元:False
不要顯示:False
別名:ExpressRouteGateway

參數集

ByExpressRouteGatewayObject
Position:Named
必要:True
來自管線的值:True
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Name

ExpressRouteGateway 名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:資源名稱, ExpressRouteGatewayName

參數集

ByExpressRouteGatewayName
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-PassThru

返回一個物件,代表您正在處理的項目。 根據預設,此 Cmdlet 不會產生任何輸出。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ResourceGroupName

資源組名。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByExpressRouteGatewayName
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ResourceId

要刪除 ExpressRouteGateway 的 Azure 資源識別碼。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:expressRouteGatewayId

參數集

ByExpressRouteGatewayResourceId
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 指令未執行。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False
別名:威斯康星州

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters

輸入

PSExpressRouteGateway

String

輸出

Boolean