Remove-AzExpressRouteConnection

Tar bort en ExpressRouteConnection.

Syntax

ByExpressRouteConnectionName (Standard)

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

ByExpressRouteConnectionResourceId

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

ByExpressRouteConnectionObject

Remove-AzExpressRouteConnection
    -InputObject <PSExpressRouteConnection>
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Tar bort en ExpressRouteConnection.

Exempel

Exempel 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
$ExpressRouteGateway = Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw"
$ExpressRouteCircuit = New-AzExpressRouteCircuit -ResourceGroupName "testRG" -Name "testExpressRouteCircuit" -Location "West Central US" -SkuTier Premium -SkuFamily MeteredData -ServiceProviderName "Equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 200
Add-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ExpressRouteCircuit -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "123.0.0.0/30" -SecondaryPeerAddressPrefix "123.0.0.4/30" -VlanId 300
$ExpressRouteCircuit = Set-AzExpressRouteCircuit -ExpressRouteCircuit $ExpressRouteCircuit
$ExpressRouteCircuitPeeringId = $ExpressRouteCircuit.Peerings[0].Id
New-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" -ExpressRouteCircuitPeeringId $ExpressRouteCircuitPeeringId -RoutingWeight 20
Remove-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection"

Ovanstående skapar en resursgrupp, Virtual WAN, Virtual Network, virtuell hubb i USA, västra i resursgruppen "testRG" i Azure. Därefter skapas en ExpressRoute-gateway i den virtuella hubben med två skalningsenheter.

När gatewayen har skapats ansluts den till ExpressRouteSite med hjälp av kommandot New-AzExpressRouteConnection.

Sedan tar den bort anslutningen med hjälp av anslutningsnamnet.

Exempel 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
$ExpressRouteGateway = Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw"
$ExpressRouteCircuit = New-AzExpressRouteCircuit -ResourceGroupName "testRG" -Name "testExpressRouteCircuit" -Location "West Central US" -SkuTier Premium -SkuFamily MeteredData -ServiceProviderName "Equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 200
Add-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ExpressRouteCircuit -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "123.0.0.0/30" -SecondaryPeerAddressPrefix "123.0.0.4/30" -VlanId 300
$ExpressRouteCircuit = Set-AzExpressRouteCircuit -ExpressRouteCircuit $ExpressRouteCircuit
$ExpressRouteCircuitPeeringId = $ExpressRouteCircuit.Peerings[0].Id
New-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" -ExpressRouteCircuitPeeringId $ExpressRouteCircuitPeeringId -RoutingWeight 20
Get-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" | Remove-AzExpressRouteConnection

Samma som exempel 1, men nu tar anslutningen bort med hjälp av piped-objektet från Get-AzExpressRouteConnection.

Parametrar

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:jfr

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Parameteregenskaper

Typ:IAzureContextContainer
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:AzContext, AzureRmContext, AzureCredential

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-ExpressRouteGatewayName

Det överordnade resursnamnet.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

ByExpressRouteConnectionName
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-Force

Be inte om bekräftelse om du vill skriva över en resurs

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-InputObject

ExpressRouteConnection-objektet som ska uppdateras.

Parameteregenskaper

Typ:PSExpressRouteConnection
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:ExpressRouteConnection

Parameteruppsättningar

ByExpressRouteConnectionObject
Position:Named
Obligatorisk:True
Värde från pipeline:True
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-Name

Resursnamnet.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:Resursnamn, ExpressRouteConnectionName

Parameteruppsättningar

ByExpressRouteConnectionName
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-PassThru

Returnerar ett objekt som representerar det objekt som du arbetar med. Som standard genererar den här cmdleten inga utdata.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-ResourceGroupName

Resursgruppens namn.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

ByExpressRouteConnectionName
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-ResourceId

Resurs-ID för ExpressRouteConnection-objektet som ska tas bort.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:ExpressRouteConnectionId

Parameteruppsättningar

ByExpressRouteConnectionResourceId
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-WhatIf

Visar vad som skulle hända om kommandot körs. Cmdleten körs inte.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:Wi

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

CommonParameters

Den här cmdleten stöder vanliga parametrar: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction och -WarningVariable. Mer information finns i about_CommonParameters.

Indata

String

PSExpressRouteConnection

Utdata

Boolean