Dela via


Remove-AzVmssExtension

Tar bort ett tillägg från VMSS.

Syntax

Remove-AzVmssExtension
      [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
      [-Name] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzVmssExtension
      [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
      [-Id] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Cmdleten Remove-AzVmssExtension tar bort ett tillägg från VMSS (Virtual Machine Scale Set).

Exempel

Exempel 1: Ta bort ett VMSS-tillägg

$vmss = Get-AzVmss -ResourceGroupName $RGName -VMScaleSetName $vmssName 
Remove-AzVmssExtension -VirtualMachineScaleSet $vmss -Name $vmssExtensionName
Update-AzVmss -ResourceGroupName $RGName -Name $vmssName -VirtualMachineScaleSet $vmss

Det här kommandot tar bort tillägget för en VMSS och uppdaterar VMSS efter ändringen.

Exempel 2: Ta bort en instans från en VMSS

$vmss = Get-AzVmss -ResourceGroupName $RGName -VMScaleSetName $vmssName 
Remove-AzVmssExtension -VirtualMachineScaleSet $vmss -Id $extensionId

Det här kommandot tar bort ange tilläggs-ID från VMSS.

Parametrar

-Confirm

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

Typ:SwitchParameter
Aliases:cf
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Typ:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Anger ID för tillägget som den här cmdleten tar bort från VMSS.

Typ:String
Position:1
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Anger namnet på tillägget som den här cmdleten tar bort från VMSS.

Typ:String
Position:1
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-VirtualMachineScaleSet

Anger vmss som tillägget ska tas bort från.

Typ:PSVirtualMachineScaleSet
Position:0
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Typ:SwitchParameter
Aliases:wi
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

Indata

PSVirtualMachineScaleSet

String

Utdata

PSVirtualMachineScaleSet