- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because you do a Get-VM without a Location parameter, that will return all the VMs.
Use
@{N = 'VM Count'; E = {( Get-VM -Location $_ | where-object { $_.powerstate -eq "poweredOff"}).Count}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference