Remove-AzVmssExtension
Removes an extension from the VMSS.
Syntax
NameParameterSet
Remove-AzVmssExtension
[-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
[-Name] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
IdParameterSet
Remove-AzVmssExtension
[-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
[-Id] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzVmssExtension cmdlet removes an extension from the Virtual Machine Scale Set (VMSS).
Examples
Example 1: Remove a VMSS extension
$vmss = Get-AzVmss -ResourceGroupName $RGName -VMScaleSetName $vmssName
Remove-AzVmssExtension -VirtualMachineScaleSet $vmss -Name $vmssExtensionName
Update-AzVmss -ResourceGroupName $RGName -Name $vmssName -VirtualMachineScaleSet $vmss
This command removes the extension of a VMSS and update the VMSS after the modification.
Example 2: Remove an instance from within a VMSS
$vmss = Get-AzVmss -ResourceGroupName $RGName -VMScaleSetName $vmssName
Remove-AzVmssExtension -VirtualMachineScaleSet $vmss -Id $extensionId
This command removes specify extension id from the VMSS.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Id
Specifies the ID of the extension that this cmdlet removes from the VMSS.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
IdParameterSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Name
Specifies the name of the extension that this cmdlet removes from the VMSS.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NameParameterSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-VirtualMachineScaleSet
Specifies the VMSS from which to remove the extension from.
Parameter properties
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs