< Back
Set-AzureRmVMExtension
Post
NAME Set-AzureRmVMExtension
SYNOPSIS
Updates extension properties or adds an extension to a virtual machine.
SYNTAX
Set-AzureRmVMExtension [-ResourceGroupName] <String> [-VMName] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>]
[-DisableAutoUpgradeMinorVersion] -ExtensionType <String> [-ForceRerun <String>] [-Location <String>] [-Name <String>] [-ProtectedSettings
<Hashtable>] -Publisher <String> [-Settings <Hashtable>] [-TypeHandlerVersion <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-AzureRmVMExtension [-ResourceGroupName] <String> [-VMName] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>]
[-DisableAutoUpgradeMinorVersion] -ExtensionType <String> [-ForceRerun <String>] [-Location <String>] [-Name <String>] [-ProtectedSettingString
<String>] -Publisher <String> [-SettingString <String>] [-TypeHandlerVersion <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Set-AzureRmVMExtension cmdlet updates properties for existing Virtual Machine Extensions or adds an extension to a virtual machine.
PARAMETERS
-AsJob [<SwitchParameter>]
Run cmdlet in the background
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DisableAutoUpgradeMinorVersion [<SwitchParameter>]
Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default,
this cmdlet enables the guest agent to update the extensions.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ExtensionType <String>
Specifies the extension type.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ForceRerun <String>
Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the
extension. The value can be any string different from the current value.
If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Location <String>
Specifies the location of the virtual machine.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of an extension.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProtectedSettings <Hashtable>
Specifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProtectedSettingString <String>
Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Publisher <String>
Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of the resource group of the virtual machine.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Settings <Hashtable>
Specifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SettingString <String>
Specifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TypeHandlerVersion <String>
Specifies the version of the extension to use for this virtual machine.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-VMName <String>
Specifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse
NOTES
Example 1: Modify settings by using hash tables
PS C:\\> $Settings = @{"fileUris" = "[]"; "commandToExecute" = ""};
PS C:\\> $ProtectedSettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey};
PS C:\\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "ContosoTest" -Publisher
"Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -Settings $Settings -ProtectedSettings $ProtectedSettings;
The first two commands use standard Windows PowerShell syntax to create hash tables, and then stores those hash tables in the $Settings and
$ProtectedSettings variables. For more information, type `Get-Help about_Hash_Tables`. The second command includes two values previously created
and stored in variables.
The final command modifies an extension of the virtual machine named VirtualMachine22 in ResourceGroup11 according to the contents of $Settings
and $ProtectedSettings. The command specifies other required information that includes the publisher and the extension type.
Example 2: Modify settings by using strings
PS C:\\> $SettingsString = '{"fileUris":[],"commandToExecute":""}';
PS C:\\> $ProtectedSettingsString = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}';
PS C:\\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "CustomScriptExtension"
-Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -SettingString $SettingsString -ProtectedSettingString
$ProtectedSettingsString ;
The first two commands create strings that contain settings, and then stores them in the $SettingsString and $ProtectedSettingsString variables.
The final command modifies an extension of the virtual machine named VirtualMachine22 in ResourceGroup11 according to the contents of
$SettingsString and $ProtectedSettingsString. The command specifies other required information that includes the publisher and the extension type.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... mextension
Get-AzureRmVMExtension
Remove-AzureRmVMExtension
SYNOPSIS
Updates extension properties or adds an extension to a virtual machine.
SYNTAX
Set-AzureRmVMExtension [-ResourceGroupName] <String> [-VMName] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>]
[-DisableAutoUpgradeMinorVersion] -ExtensionType <String> [-ForceRerun <String>] [-Location <String>] [-Name <String>] [-ProtectedSettings
<Hashtable>] -Publisher <String> [-Settings <Hashtable>] [-TypeHandlerVersion <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-AzureRmVMExtension [-ResourceGroupName] <String> [-VMName] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>]
[-DisableAutoUpgradeMinorVersion] -ExtensionType <String> [-ForceRerun <String>] [-Location <String>] [-Name <String>] [-ProtectedSettingString
<String>] -Publisher <String> [-SettingString <String>] [-TypeHandlerVersion <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Set-AzureRmVMExtension cmdlet updates properties for existing Virtual Machine Extensions or adds an extension to a virtual machine.
PARAMETERS
-AsJob [<SwitchParameter>]
Run cmdlet in the background
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DisableAutoUpgradeMinorVersion [<SwitchParameter>]
Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default,
this cmdlet enables the guest agent to update the extensions.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ExtensionType <String>
Specifies the extension type.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ForceRerun <String>
Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the
extension. The value can be any string different from the current value.
If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Location <String>
Specifies the location of the virtual machine.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of an extension.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProtectedSettings <Hashtable>
Specifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProtectedSettingString <String>
Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Publisher <String>
Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of the resource group of the virtual machine.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Settings <Hashtable>
Specifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SettingString <String>
Specifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TypeHandlerVersion <String>
Specifies the version of the extension to use for this virtual machine.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-VMName <String>
Specifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse
NOTES
Example 1: Modify settings by using hash tables
PS C:\\> $Settings = @{"fileUris" = "[]"; "commandToExecute" = ""};
PS C:\\> $ProtectedSettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey};
PS C:\\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "ContosoTest" -Publisher
"Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -Settings $Settings -ProtectedSettings $ProtectedSettings;
The first two commands use standard Windows PowerShell syntax to create hash tables, and then stores those hash tables in the $Settings and
$ProtectedSettings variables. For more information, type `Get-Help about_Hash_Tables`. The second command includes two values previously created
and stored in variables.
The final command modifies an extension of the virtual machine named VirtualMachine22 in ResourceGroup11 according to the contents of $Settings
and $ProtectedSettings. The command specifies other required information that includes the publisher and the extension type.
Example 2: Modify settings by using strings
PS C:\\> $SettingsString = '{"fileUris":[],"commandToExecute":""}';
PS C:\\> $ProtectedSettingsString = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}';
PS C:\\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "CustomScriptExtension"
-Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -SettingString $SettingsString -ProtectedSettingString
$ProtectedSettingsString ;
The first two commands create strings that contain settings, and then stores them in the $SettingsString and $ProtectedSettingsString variables.
The final command modifies an extension of the virtual machine named VirtualMachine22 in ResourceGroup11 according to the contents of
$SettingsString and $ProtectedSettingsString. The command specifies other required information that includes the publisher and the extension type.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... mextension
Get-AzureRmVMExtension
Remove-AzureRmVMExtension