Get location of Hyper-V Virtual Machines and disk

In case you need to migrate all of VMs storage to another drive in Hyper-V server, you need to get the list of VMs and its virtual disk location.
Here’s a one-liner to list the location of the VM files:

get-vm * |sort-object| ft -auto Name,path,configurationlocation,snapshotfilelocation,@{L="Disks";E={$_.harddrives.path}}

Leave a Reply

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