This script is a intended for moving a VHD to Azure using PowerShell with Azure Resource Manager 5.1 module. Then in the Azure portal we will create an image from the VHD, this will help us to be able to provision VMs from that image. 

For the complete step-by-step please refer to: https://social.technet.microsoft.com/wiki/contents/articles/52418.migrating-vhd-to-azure-using-powershell-arm-5-x.aspx

Feel free to contribute to the Github repo: https://github.com/daveRendon/Moving-VHD-to-Azure-with-PowerShell-and-create-VM-image/blob/master/src/moving-vhd-to-Azure-create-vm-image.ps1