1: 2: 3: 4: 5: 6: 7:
$VMHost = "VMHost01.Contoso.com" $Path = (Get-VMHost $VMHost).VMPaths[0] $VMServer = "VMMServer01.Contoso.com" Get-VM -VMMServer $VMServer | Where-Object { $_.Name -Like "VM100*" } | ForEach-Object { Move-VM -VM $_ -VMHost $VMHost -Path $Path }