Set-AzureRmVMExtension does not work
Unable to use Set-AzureRmVMExtension does not work and I run into the following error:
Set-AzureRmVMExtension : Cannot bind parameter because parameter 'TypeHandlerVersion' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3". At line:1 char:184
- ... so.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" - ...
-
~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidArgument: (:) [Set-AzureRmVMExtension], ParameterBindingException
- FullyQualifiedErrorId : ParameterAlreadyBound,Microsoft.Azure.Commands.Compute.SetAzureVMExtensionCommand
Below are the commands:
$Settings = '{"fileUris":[https://storageaccount.blob.core.windows.net/scripts/script.sh], "commandToExecute":"sh script.sh"}'
Set-AzureRmVMExtension -ResourceGroupName "rg-testvms1" -Location "East US" -VMName "testvm3" -Name "CustomScriptExtension" -Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -SettingString $Settings;
@Vijayaraghavanl Looks like the type parameter is actually called -ExtensionType and we need to alias it correctly and update the examples. @hyonholee Can we improve the error message as well?
Good Catch.. I just used the examples as in https://msdn.microsoft.com/en-us/library/mt603745.aspx.... Thanks for pointing out.. Cheers!!