For the past couple days now, I have been trying to compact a couple virtual machine hard drives VHDX via Hyper-V Manager. One of them worked without a hitch, however the other one I would go to Hyper-V manager, click edit disk and follow the normal procedures, but when I clicked finish, the box would just go away without it ever actually changing the size. I found a fix around this using a one line PowerShell command!
A few days ago, I used Vmware P2V tool to convert my physical server to a virtual server. After doing that, I wiped the machine. I then decided to use Hyper-V instead. I had to find a way to convert the hard drive to a Hyper-V .VHDX disk instead of a VMWare disk without having an actual running VMWare server.