VMware Cloud Community
bairstowscott
Contributor
Contributor
Jump to solution

help with powercli error message

$path = @()

$cluster = 'cluster_01'

$parent = Get-View $cluster.ExtensionData.ResourcePool

while ($parent.parent){ 

    $parent = Get-View $parent.parent

    $path += $parent.Name

}

Why am I getting this error message?

Capture.PNG

Reply
0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

Hello, -

The problem there is that you are making the cluster variable a string value, rather than something that represents a cluster object.

Instead of the previous line (the 2nd line), try it like:

$cluster = Get-Cluster 'cluster_01'

Then the third line should succeed.  That do it for you?

View solution in original post

Reply
0 Kudos
1 Reply
mattboren
Expert
Expert
Jump to solution

Hello, -

The problem there is that you are making the cluster variable a string value, rather than something that represents a cluster object.

Instead of the previous line (the 2nd line), try it like:

$cluster = Get-Cluster 'cluster_01'

Then the third line should succeed.  That do it for you?

Reply
0 Kudos