Add-AzVmssExtension

Adds an extension to the VMSS.

Syntax

Add-AzVmssExtension
   [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
   [[-Name] <String>]
   [[-Publisher] <String>]
   [[-Type] <String>]
   [[-TypeHandlerVersion] <String>]
   [[-AutoUpgradeMinorVersion] <Boolean>]
   [[-Setting] <Object>]
   [[-ProtectedSetting] <Object>]
   [-ForceUpdateTag <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Add-AzVmssExtension cmdlet adds an extension to the Virtual Machine Scale Set (VMSS).

Examples

Example 1: Add an extension to the VMSS

PS C:\> Add-AzVmssExtension -VirtualMachineScaleSet $VMSS -Name $ExtName -Publisher $Publisher -Type $ExtType -TypeHandlerVersion $ExtVer -AutoUpgradeMinorVersion $True

This command adds an extension to the VMMS.

Parameters

-AutoUpgradeMinorVersion

Indicates whether the extension version should be automatically updated to a newer minor version.

Type:Boolean
Position:5
Default value:None
Required:False
Accept pipeline input:True
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

-ForceUpdateTag

If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed.

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

-Name

Specifies the name of the extension that this cmdlet adds.

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

-ProtectedSetting

Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.

Type:Object
Position:7
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Publisher

Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. This can use the Get-AzVMImagePublisher cmdlet to get the publisher.

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

-Setting

Specifies the public configuration, as a string, for the extension. This cmdlet does not encrypt public configuration.

Type:Object
Position:6
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Type

Specifies the extension type. You can use the Get-AzVMExtensionImageType cmdlet to get the extension type.

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

-TypeHandlerVersion

Specifies the version of the extension to use for this virtual machine. You can use the Get-AzVMExtensionImage cmdlet to get the version of the extension.

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

-VirtualMachineScaleSet

Specify the VMSS object. You can use the New-AzVmssConfig to create the object.

Type:PSVirtualMachineScaleSet
Position:0
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

VirtualMachineScaleSet

Parameter 'VirtualMachineScaleSet' accepts value of type 'VirtualMachineScaleSet' from the pipeline

Outputs

None

This cmdlet does not generate any output.