VMware Cloud Community
vlife201110141
Enthusiast
Enthusiast
Jump to solution

Get-Cluster

Hello,

Instead of writing

$cluster = Get-Cluster -Name "PROD_WINDOWS", "PROD_LINUX", "TEST_LINUX_WINDOWS"

how to convert it all clusters except "EVC TEST"

get-view -viewtype "ClusterComputeResource" -filter @{"Name" -ne "EVC TEST"}

Smiley Happy not working

Reply
0 Kudos
1 Solution

Accepted Solutions
ykalchev
VMware Employee
VMware Employee
Jump to solution

You can do client-side filtering using where-object ps cmdlet:

Get-Cluster | ? {$_.Name -ne "EVC Test"}

or

get-view -viewtype "ClusterComputeResource" | ? {$_.Name -ne "EVC Test"}

Regards,

Yasen

Yasen Kalchev, vSM Dev Team

View solution in original post

Reply
0 Kudos
3 Replies
john23
Commander
Commander
Jump to solution

This will not work this way. since the output of the command

get-view -viewtype "ClusterComputeResource" is hash literal.(key and value format)

since when you give "Name"  = EVC Test (it has key and matching value both)

Thanks -A Read my blogs: www.openwriteup.com
Reply
0 Kudos
ykalchev
VMware Employee
VMware Employee
Jump to solution

You can do client-side filtering using where-object ps cmdlet:

Get-Cluster | ? {$_.Name -ne "EVC Test"}

or

get-view -viewtype "ClusterComputeResource" | ? {$_.Name -ne "EVC Test"}

Regards,

Yasen

Yasen Kalchev, vSM Dev Team
Reply
0 Kudos
john23
Commander
Commander
Jump to solution

Thanks Smiley Happy

Thanks -A Read my blogs: www.openwriteup.com
Reply
0 Kudos