Counts of VM's running specific OS types
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht9bDJ-15dxbcqahF80VsuGxOVLovR9ERjT7Ic0-U6tWlfetx4dGqkyfqs_ubSkwBxz7AbXVGawqg0bJv4BcxsoLF0YFt1O_VextIXshpK6U5llMNjjGHnrEMXf0uWr39Nw5M2EqraUCzG/s1600/atl7d074422_na_autotrader_int__Desktop_.png)
This was a fun little exercise for me in getting a count of VM's per OS type spawned off by a question in the vmware communities board . The result would look something like this: It's quite simple and probably could be written a bit more efficiently, but ran sufficiently fast enough for me. $TotalVMs = Get-View -ViewType VirtualMachine -Property Name,'Summary.Config.GuestFullName' $OSFilters = $TotalVMs | select -ExpandProperty summary | select -expandproperty config | select -unique guestfullname | sort $MyCustomReport = New-Object PSObject Foreach ($OSFilter in $OSFilters) {$MyCustomReport | Add-Member -Name $OSFilter.GuestFullName -MemberType NoteProperty -Value ($totalvms | select -expandproperty summary | select -expandproperty config | where {$_.GuestFullName -eq $OSFilter.guestfullname}).count} $MyCustomReport | Add-member -Name Total -MemberType NoteProperty -Value $TotalVMs.Count $MyCustomReport