Skip to content

Instantly share code, notes, and snippets.

@a73xsh
Created September 14, 2017 11:26
Show Gist options
  • Save a73xsh/f0b59ce3b897b181c1ca927ae17a9c0f to your computer and use it in GitHub Desktop.
Save a73xsh/f0b59ce3b897b181c1ca927ae17a9c0f to your computer and use it in GitHub Desktop.
VmWare VM PowerState
$vms = Get-Cluster <cluster_name> | Get-VM
write-host "Powered on: " ($vms | where {$_.PowerState -eq "PoweredOn"}).Count
write-host "Powered off: " ($vms | where {$_.PowerState -eq "PoweredOff"}).Count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment