VMware Cloud Community
windvally
Contributor
Contributor
Jump to solution

How to list all VMs‘ name

I want display a list for all VMs' name.

Get-VM will export to many info,how to filter the info i need?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

With the Select-Object cmdlet, like this

Get-VM | Select Name

The Get-VM produces objects which you pass through the pipeline ('|') to the Select-Object cmdlet.

The Select-Object cmdlet allows you to select one or more of the properties of the objects it recieves.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

With the Select-Object cmdlet, like this

Get-VM | Select Name

The Get-VM produces objects which you pass through the pipeline ('|') to the Select-Object cmdlet.

The Select-Object cmdlet allows you to select one or more of the properties of the objects it recieves.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
windvally
Contributor
Contributor
Jump to solution

Thanks LucD!

There're so much knowledge I need to learn from you !

0 Kudos
LucD
Leadership
Leadership
Jump to solution

In My PS Library post you'll find some links to learning resources for PowerShell.

Josh also did a nice overview of getting started resources, see his Resources for Getting Started with #PowerCLI Automation


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos