- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is what you script is doing, you're getting all the VMs for each iteration through data/cluster.
To limit it to only to the VMs in a cluster, use the SearchRoot parameter.
Replace the line with
$vms = Get-view -ViewType VirtualMachine -SearchRoot $cluster.ExtensionData.MoRef
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference