Uploading custom VHD in Azure using PowerShell

PowerShell script below will allow you  to upload your custom VHD image to Azure Subscription for example (Win 2008 Server) or other (Windows X version) VHD to upload. In this script just change the variables as per your custom choice (In my case i just mentioned as per my choice for example region is East Australia but you need to choose which suits you). Sequence of script is to ->Create Storage account->Upload custom VHD image in storage account container.

#=======================================
# Define your variables in below
#=======================================
$StorageAccountName = "NameYourStorageAccount"
$Location = "Australia East...mentioned your own"
$ContainerName = "NameOfyourContainer"
$LocalVHD = "Drive\Location of your folder having custom VHD\VHD_Name.vhd"
$AzureVHD = "https://NameYourStorageAccount.blob.core.windows.net/NameOfyourContainer/VHD_Name.vhd"
$DiskName = "MyCustomDisk"
$LabelName = "MyCustomDiskLable"
$VMImageName = "MyCustomImage"
#=======================================
New-AzureStorageAccount –StorageAccountName $StorageAccountName -Location $Location
Set-AzureSubscription -CurrentStorageAccountName $StorageAccountName -SubscriptionName $Subscription
New-AzureStorageContainer -Name $ContainerName -Permission Off
Get-AzureStorageAccount | Format-Table -Property Label
Add-AzureVhd -LocalFilePath $LocalVHD -Destination $AzureVHD
Add-AzureDisk -DiskName $DiskName -MediaLocation $AzureVHD -Label $LabelName -OS Windows
Add-AzureVMImage -ImageName $VMImageName -MediaLocation $AzureVHD -OS Windows