# encoding: ascii
# api: powershell
# title: Determine capacity of RA
# description: Get the capacity of your installed RAM with the Win32_PhysicalMemory WMI class.
# version: 0.1
# type: class
# author: Florian Frank
# license: CC0
# x-poshcode-id: 4564
# x-derived-from-id: 4565
# x-archived: 2015-10-25T13:42:35
# x-published: 2015-10-27T22:21:00
#
#
# Type long (64-bit integer) is necessary because the WMI class state the capacity in byte --> might be too long for int32 ;-)
[long]$memory = 0
# Get the WMI class Win32_PhysicalMemory and total the capacity of all installed memory modules
Get-WmiObject -Class Win32_PhysicalMemory | ForEach-Object -Process { $memory += $_.Capacity }
# Display the output in Gigabyte
$memory / 1GB