Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Created January 12, 2018 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mczerniawski/dad726ac1ef101261146b69ed19763b3 to your computer and use it in GitHub Desktop.
Save mczerniawski/dad726ac1ef101261146b69ed19763b3 to your computer and use it in GitHub Desktop.
$VMName = 'SomeVM'
#Get VM disk path. Assuming there's only one VHD here
$VHDPath = Get-VMHardDiskDrive $VMName | Select-Object -ExpandProperty Path
#Verify VHD information, including current size
Get-VHD -Path $VHDPath
#Expand the disk
$newSize = 120GB
Resize-VHD -Path $VHDPath -SizeBytes $newSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment