CaptPete3
Contributor
Contributor

Hey Luc - Sorry I haven't responded I was out for a few days.  I came up with the two scripts below and they're working.

 

foreach($vmlist in (Get-Content -Path C:\TEMP\vmlist.txt)){
$vm = Get-VM -Name $vmlist
Move-VM $vm -Datastore SVC_PRD_C01 -DiskStorageFormat Thin -RunAsync
}

 

or

##All VM's in a datastore cluster or datastore to another.
Get-VM -Datastore Source Datastore Name | Move-VM -Datastore Target Datastore -DiskStorageFormat thin -RunAsync

 

Reply
0 Kudos