I needed a quick one-liner today to help me find out how many HBA’s my hosts had, the following one-liner needs no more introduction:
Get-VMHost | Select Name, @{N="FibreHBAs";E={($_ | Get-VMHostHba | Where { $_.Type -eq "FibreChannel"} | Measure-Object).Count}} | Out-GridView
Output: