In this post I will show you two One-Liners that will get you some info of where the VM is placed or running on.
The first one-liner will show all the VMs’ and the ResourcePool where the VM’s are placed.
Get-VM |Select Name, @{N="ResourcePool";E={Get-ResourcePool -VM $_}}
The second One-Liner will show the VM’s and the ESX server where the VM’s are running.
Get-VM |Select Name, @{N="ESX";E={Get-VMHost -VM $_}}