how do I re-write this code to on a power vm be able
1. to move hd to another datastore and thin provision it
2. reloate that vm to the new datastore
Connect-VIServer -Server xxx -User xxx -Password xxx;
#Varialble
$vms = Get-VM -Name xxxx;
$datastore = Get-Datastore -Name "VM4"
foreach ($vm in $vms) {
#thin provisions HD on new datastore
Get-VM -Name "$vm" | Get-HardDisk | Set-HardDisk -Datastore $datastore
-StorageFormat Thin;
#move the rest of vm to new store
Move-VM -VM $vm -Datastore $datastore;
}