I am trying create a on-liner script which gives an outputs of Hosts and vm's counts in a vcenter cluster like as below.

Just using a sample oneliner Get-VMHost | Select @{N=“Cl“;E={Get-Cluster -VMHost $_}} Name, @{N=“NumVM“;E={($_ | Get-VM).Count}} | Sort Cluster, Name
any Ideas?? Thanks in advance
Regards, Subash.