0

I have a dynamic VHDX file/virtual hard drive that contains 3 partitions and 30GB of unallocated space.

How can I shrink the VHDX file/virtual hard drive by getting rid of that unallocated space inside it?

Apparently, it is possible with a Powershell command like so:

Resize-VHD -Path '\SomePath\My-VHD-File.vhdx' -ToMinimumSize

However, this doesn't seem to work on Windows 10 Professional, as it only seems to be available on Windows Server OSes.

Hannu
  • 10,568
David.P
  • 683

2 Answers2

2

Resize-VHD is a Hyper-V tool cmdlet.

To install the Hyper-V cmdlets, run PowerShell as Administrator and enter:

Install-WindowsFeature -Name RSAT-Hyper-V-Tools
harrymc
  • 498,455
0

Similar as @sz, I had to install the optional Windows 10 Hyper-V components (all of them, for some reason), and reboot.

Afterwards, the above Powershell command worked, and shrunk my VHDX file in about one second by 30GB.

David.P
  • 683