Count of powered-on VMs in a cluster

Great couple of one-liners and some thoughts on speeding them up: How many Powered On VMs are running on my host + Speed up your PowerCLI cmdlets! | Boerlowie’s Blog.

I was looking for this to get a quick way to count the number of VMs powered up in a cluster:

get-cluster Cluster01 | get-vm | where {$_.PowerState -eq "PoweredOn"} | measure-object

The article lists some ways to speed up the above by using get-view, but if you are looking for something quick and dirty, this will do the trick.