vlife201110141
Enthusiast
Enthusiast

Get-Cluster

Jump to solution

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

0 Kudos
1 Solution

Accepted Solutions
ykalchev
VMware Employee
VMware Employee

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

0 Kudos
3 Replies
john23
Commander
Commander

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
0 Kudos
ykalchev
VMware Employee
VMware Employee

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

0 Kudos
john23
Commander
Commander

Thanks Smiley Happy

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