THE COMPTGUY
THE COMPTGUY

Reputation: 33

How to find memory size on Windows 7 64 bit using powershell

I am trying following command, but it does not display the size:

Get-WmiObject Win32_PhysicalMemory

Please let me know what I am doing wrong here.

Thanks

Upvotes: 1

Views: 82

Answers (3)

bakerjw
bakerjw

Reputation: 11

$WMI_ComputerSystem = Get-WmiObject -computername $Current_System.Computer_Name -class Win32_computersystem $WMI_ComputerSystem.TotalPhysicalMemory

Is not accurate.

$WMI_PM = Get-WmiObject -computername $Current_System.Computer_Name -class Win32_physicalmemory

Returns the size of each DIMM. You can parse through each of the returned values and add them up for an accurate value.

Upvotes: 0

user2209888
user2209888

Reputation: 13

The easiest to read would be:

 [Math]::Round(((Get-WmiObject -Class Win32_ComputerSystem | Select -Expand  TotalPhysicalMemory)/ 1GB),2)

Upvotes: 0

David Jones
David Jones

Reputation: 3362

gwmi win32_computersystem | select totalphysicalmemory

Upvotes: 1

Related Questions