Set-AzureVMExtension

Sets resource extensions for virtual machines.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Set-AzureVMExtension
   [-ExtensionName] <String>
   [-Publisher] <String>
   [-Version] <String>
   [[-ReferenceName] <String>]
   [[-PublicConfiguration] <String>]
   [[-PrivateConfiguration] <String>]
   [-Disable]
   [-Uninstall]
   [[-PublicConfigKey] <String>]
   [[-PrivateConfigKey] <String>]
   [-ForceUpdate]
   -VM <IPersistentVM>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureVMExtension
   [-ExtensionName] <String>
   [-Publisher] <String>
   [-Version] <String>
   [[-ReferenceName] <String>]
   [[-PublicConfigPath] <String>]
   [[-PrivateConfigPath] <String>]
   [-Disable]
   [-Uninstall]
   [[-PublicConfigKey] <String>]
   [[-PrivateConfigKey] <String>]
   [-ForceUpdate]
   -VM <IPersistentVM>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureVMExtension
   [-ReferenceName] <String>
   [[-PublicConfiguration] <String>]
   [[-PrivateConfiguration] <String>]
   [-Disable]
   [-Uninstall]
   [[-PublicConfigKey] <String>]
   [[-PrivateConfigKey] <String>]
   [-ForceUpdate]
   -VM <IPersistentVM>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureVMExtension
   [-ReferenceName] <String>
   [[-PublicConfigPath] <String>]
   [[-PrivateConfigPath] <String>]
   [-Disable]
   [-Uninstall]
   [[-PublicConfigKey] <String>]
   [[-PrivateConfigKey] <String>]
   [-ForceUpdate]
   -VM <IPersistentVM>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The Set-AzureVMExtension cmdlet sets resource extensions for virtual machines.

Examples

Example 1: Create a virtual machine with resource extensions applied

PS C:\> $X = New-AzureVMConfig -Name $VM -InstanceSize Small -ImageName $IMG;$X = Add-AzureProvisioningConfig -VM $X -Password $PWD -AdminUsername $USR -Windows;$X = Set-AzureVMExtension -VM $X -ExtensionName $Ext1 -Publisher $Publisher -Version $VER -PublicConfiguration $P1 -PrivateConfiguration $P2;$X = Set-AzureVMExtension -VM $X -ExtensionName $Ext2 -Publisher $Publisher -Version $VER -PublicConfiguration $P3 -PrivateConfiguration $P4;New-AzureVM -Location $LOC -ServiceName $SVC -VM $X;

This command creates a virtual machine with resource extensions applied.

Parameters

-Disable

Indicates that this cmdlet disables the extension state.

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

-ExtensionName

Specifies the extension name of the virtual machine.

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

-ForceUpdate

Indicates that this cmdlet re-applies a configuration to an extension when the configuration has not been updated.

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

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

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

-PrivateConfigKey

Specifies a private configuration key.

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

-PrivateConfigPath

Specifies the private configuration path.

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

-PrivateConfiguration

Specifies the private configuration text.

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

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

-PublicConfigKey

Specifies the public configuration key.

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

-PublicConfigPath

Specifies the public configuration path.

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

-PublicConfiguration

Specifies the public configuration text.

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

-Publisher

Specifies the publisher of the extension.

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

-ReferenceName

Specifies the reference name of the extension.

This is a user-defined string that can be used to refer to an extension. You need to specify it when the extension is added to the virtual machine for the first time. For subsequent updates, you need to specify the previously used reference name while updating the extension. The ReferenceName assigned to an extension is returned using the Get-AzureVM cmdlet.

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

-Uninstall

Indicates that this cmdlet uninstalls the resource extension from the virtual machine.

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

-Version

Specifies the extension version.

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

-VM

Specifies the persistent virtual machine object.

Type:IPersistentVM
Aliases:InputObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False