PowerShell: How to return all the VMs in a Hyper-V Cluster

Question:

I’m a first time programmer with PowerShell. Running on Windows Server 2012.

I’m trying to get a list of all VM’s on my failover cluster and am working with this:

And this returns a bunch of errors

However, this works perfectly fine

Is it failing because Get-ClusterNode | select Name returns the following?

with a heading and underline?

Answer:

Give this a shot:

You have to reference the Name property of the objects returned by Get-ClusterNode.

Source:

PowerShell: How to return all the VMs in a Hyper-V Cluster by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply