VMware Cloud Community
Al_
Enthusiast
Enthusiast
Jump to solution

Filter ouput for VM name only

Using LucD's query: Get-VM -Tag oit | where{(Get-VM -Tag test).Name -Contains $_.Name}

returns:

Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------

How can we return Name only? I tried (Get-VM -Tag oit | where{(Get-VM -Tag test).Name -Contains $_.Name}).Name with no luck..

 

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try with

Get-VM -Tag oit | where{(Get-VM -Tag test).Name -Contains $_.Name} |
Select Name


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try with

Get-VM -Tag oit | where{(Get-VM -Tag test).Name -Contains $_.Name} |
Select Name


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

0 Kudos
Al_
Enthusiast
Enthusiast
Jump to solution

That works. Thanks!

0 Kudos