I’m new to powershell.
I refered to http://msdn.microsoft.com/en-us/library/windowsazure/jj152815.aspx example 3.
here is my cmd:
$myVM = New-AzureVMConfig -Name “MyVM2” -InstanceSize Extrasmall -ImageName (Get-AzureVMImage)[4].ImageName| Add-AzureProvisioningConfig -VM PersistentVMRole -Windows -Password "Password1!"| Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel “DataDisk50” -LUN 0
But I get the error here:
New-AzureVMConfig : A positional parameter cannot be found that accepts argument ‘Add-AzureProvisioningConfig’.
At line:1 char:26
+ $myVM = New-AzureVMConfig <<<< -Name “MyVM2” -InstanceSize Extrasmall -ImageName (Get-AzureVMImage)[4].ImageName| A| Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel ”
dd-AzureProvisioningConfig -Windows -Password "Password1!"
DataDisk50″ -LUN 0
+ CategoryInfo : InvalidArgument: (:) [New-AzureVMConfig], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.New
AzureVMConfigCommand
Please can anyone explain why does this example can’t be run? I’m going to crazy!
There’s a couple of problems with this script:
Some of the VM documentation can contain inconsistencies a much better reference point to get started is Michael Washam’s blog http://michaelwasham.com or this may help you if you swap out the sql image for the one you’re interested in http://blog.elastacloud.com/2012/06/30/tricks-with-iaas-and-sql-part-1-installing-sql-server-2012-vms-using-powershell/