I need to move storage for a large number of VMs. The powershell for a single VM is simple “Move-VMStorage VM1 -DestinationStoragePath C:\ClusterStorage\Hyper-V\VMName”. However, i have too many VMs to move. So to move all, i would like to fetch several VMs based on a condition “Get-VM | where {$_.path -like ‘D:\OldPath’}”, and then pipe the results (or ForEach) to a Move-VMStorage, and using the VMname as the folder name. So for example, if the VM name is “VM1”, then the command should be “Move-VMStorage VM1 -DestinationStoragePath C:\ClusterStorage\Hyper-V\VM1”. I just cant figure out this simple task…
I also need to make sure that it wont cycle to next one before completing the previous one (else ill chock the storage network)