Files
PowerCLI-Example-Scripts/Scripts/Get-TotalMemoryAllocation.ps1
2017-09-20 19:37:36 +01:00

7 lines
293 B
PowerShell

#Script gets total memory allocation in GB of all powered on VMs in the environment
#Author: Chris Bradshaw via https://isjw.uk/powercli-snippet-total-memory-allocation/
[System.Math]::Round(((get-vm |
where-object{$_.PowerState -eq "PoweredOn" }).MemoryGB |
Measure-Object -Sum).Sum ,0)