PowerCli one liner to get the number of VMs per datacenter

You have to have the snapin loaded and connected to your vcenter.

get-datacenter | sort name | %{$_.name; Get-vm -Location $_ | Measure-object| select Count}