Hyper-V 2.0: Get all VM’s in Cluster

Quick script to find all VM’s running in a Hyper-V cluster (Windows 2012). You will need to run this command on a Hyper-V host in powershell.

$clusterNodes = Get-ClusterNode;
ForEach($item in $clusterNodes)
{Get-VM -ComputerName $item.Name; }