Set-AzureRmVmss

Sets specific actions on a specified VMSS.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Set-AzureRmVmss
   [-ResourceGroupName] <String>
   [-VMScaleSetName] <String>
   [[-InstanceId] <String[]>]
   [-Reimage]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmVmss
   [-ResourceGroupName] <String>
   [-VMScaleSetName] <String>
   [[-InstanceId] <String[]>]
   [-ReimageAll]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmVmss
   [-ResourceGroupName] <String>
   [-VMScaleSetName] <String>
   [[-InstanceId] <String[]>]
   [-Redeploy]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmVmss
   [-ResourceGroupName] <String>
   [-VMScaleSetName] <String>
   [[-InstanceId] <String[]>]
   [-PerformMaintenance]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzureRmVmss cmdlet sets specific actions on the Virtual Machine Scale Set (VMSS). The only action this cmdlet supports is Reimage.

Examples

Example 1: Reimage a VMSS

PS C:\> Set-AzureRmVmss -Reimage -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS"

This command reimages the VMSS named ContosoVMSS that belongs to the resource group named ContosoGroup.

Parameters

-AsJob

Run cmdlet in the background and return a Job to track progress.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InstanceId

The instance ID of the virtual machine.

Type:String[]
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PerformMaintenance

Indicates that this cmdlet performs maintenance one or more virtual machines in the VMSS.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Redeploy

Indicates that the cmdlet redeploys one or more virtual machines in the VMSS.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Reimage

Indicates that the cmdlet reimages the VMSS.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReimageAll

Indicates that the cmdlet reimages all the disks in the VMSS.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Specifies the name of the resource group of the VMSS.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMScaleSetName

Species the name of the VMSS for which this cmdlet sets actions on.

Type:String
Aliases:Name
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

String[]

Outputs

PSOperationStatusResponse