Resize a virtual machine

$rgname = "rg-allen"
$vmname = "vm01"
$vm = Get-AzVM -ResourceGroupName $rgname -VMName $vmname
$vm.HardwareProfile.VmSize = 'Standard_B2s'
Update-AzVM -VM $vm 
-ResourceGroupName $rgname

Verify that the VM has been rightsized to your new SKU

(Get-AzVM `
-ResourceGroupName $rgname `
-VMName $vmname).HardwareProfile.VmSize

3 comments

  1. Thank you for sharing superb informations. Your site is very cool. I’m impressed by the details that you have on this web site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found simply the info I already searched all over the place and just could not come across. What a perfect site.

Leave a comment

Your email address will not be published. Required fields are marked *