$rgName = "tmp" $ssName = "ss name" # Get information about the scale set $vmss = Get-AzureRmVmss ` -ResourceGroupName $rgName ` -VMScaleSetName $ssName -Verbose # Add the Custom Script Extension to install IIS and configure basic website $vmss = Add-AzureRmVmssExtension ` -VirtualMachineScaleSet $vmss ` -Name "customScript" ` -Publisher "Microsoft.Compute" ` -Type "CustomScriptExtension" ` -TypeHandlerVersion 1.8 ` -Setting $customConfig # Update the scale set and apply the Custom Script Extension to the VM instances Update-AzureRmVmss ` -ResourceGroupName $rgName ` -Name $ssName ` -VirtualMachineScaleSet $vmss -Verbose