Reputation: 33
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
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
Reputation: 13
The easiest to read would be:
[Math]::Round(((Get-WmiObject -Class Win32_ComputerSystem | Select -Expand TotalPhysicalMemory)/ 1GB),2)
Upvotes: 0