PowerCLI: Two One-Liners


image 

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 $_}}

 image

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 $_}} 

image

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s