Get location of Hyper-V Virtual Machines and disk

Get location of Hyper-V Virtual Machines and disk

August 16, 2019

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 Comments

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

Copyright ©2023 All rights reserved