title: Powercli Script to count the ESXI-Host and its Vm's on each clusters
body: <p>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.</p>
  
  <p><img src="https://i.stack.imgur.com/VkptU.png" alt="enter image description here"></p>
  
  <p><strong>Just using a sample oneliner</strong>
  <em>Get-VMHost | Select @{N=“Cl“;E={Get-Cluster -VMHost $_}} Name, @{N=“NumVM“;E={($_ | Get-VM).Count}} | Sort Cluster, Name</em></p>
  
  <p>any Ideas?? Thanks in advance  </p>
  
  <p>Regards,
  Subash.</p>