Knowing the total RAM size of the Windows computer is essential for various reasons, whether you're planning an upgrade, troubleshooting performance issues, or simply satisfying your curiosity about the system's capabilities. This tutorial demonstrates how to get total RAM size on Windows.
Using PowerShell, the following command can be used to get the total RAM size of the Windows computer in gigabytes (GB):
(Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum /1gb
The command uses the Get-CimInstance
cmdlet to query information about physical memory (RAM) using the Win32_PhysicalMemory
class. It retrieves a list of objects representing each physical memory module installed in the computer. After getting the list of memory modules, the Measure-Object
cmdlet is used to calculate the sum of their capacities. After executing the first part of the command, you will have the sum of the memory module capacities in bytes. To make the result more human-readable, it is expressed in gigabytes (GB).
Leave a Comment
Cancel reply