Use Windows Powershell To Display RAM Inside Computer

How to show the type & speed of the RAM in your computer using Windows Powershell.

  1. Open Windows Powershell as Administraor.
    To do this right-click the Start Menu and click Windows Powershell (Admin)
  2.  Copy the text code above. Paste into Powershell then hit enter on the keyboard.
    So within the Powershell (blue command box) CTRL and V to paste.

If you are thinking of upgrading the memory in your laptop or desktop, match up the RAM to the same speed.

Here is the script to copy into Windows Powershell. This will show slots used, slots available, total memory installed and RAM speed for each slot that is in there.

Paste The Following Script Into Windows Powershell

    [string]$Computername = "localhost" 
$PysicalMemory = Get-WmiObject -class "win32_physicalmemory" -namespace "root\CIMV2" -ComputerName $Computername 
Write-Host "Computroon Support 07488283150 RAM Modules:" -ForegroundColor Green 
$PysicalMemory | Format-Table Tag,BankLabel,@{n="Capacity(GB)";e={$_.Capacity/1GB}},Manufacturer,PartNumber,Speed -AutoSize 
Write-Host "Total Memory:" -ForegroundColor Green 
Write-Host "$((($PysicalMemory).Capacity | Measure-Object -Sum).Sum/1GB)GB" 
$TotalSlots = ((Get-WmiObject -Class "win32_PhysicalMemoryArray" -namespace "root\CIMV2" -ComputerName $Computername).MemoryDevices | Measure-Object -Sum).Sum 
Write-Host "`nTotal Memory Slots:" -ForegroundColor Green 
Write-Host $TotalSlots 
$UsedSlots = (($PysicalMemory) | Measure-Object).Count  
Write-Host "`nUsed Memory Slots:" -ForegroundColor Green 
Write-Host $UsedSlots 
If($UsedSlots -eq $TotalSlots) 
    Write-Host "All memory slots are filled up, none is empty!" -ForegroundColor Yellow 

Video instructions for using this code.




Computroon Support.




Leave a Reply