PowerShell script below list physical memory information.
Script displays the: memory capacity, memory type, speed and serial number.
Get physical memory information using PowerShell script.
========================================
$memory_info = Get-WmiObject -class Win32_PhysicalMemory
foreach ($mem_values
in $memory_info)
{
“Caption : ” +
[char]9 + $mem_values.Caption
“Speed : ” + [char]9 + $mem_values.speed +”ns”
“Serial number
: ” +
[char]9 + $mem_values.SerialNumber
$xval= $mem_values.Capacity /1MB
Write-output("Capacity
: " + [char]9 + $xval + "MB")
$xmem = $mem_values.MemoryType
switch ($xmem)
{
0
{"Memory type :"+[char]9 +[char]9 + "Unknown"+[char]10}
1
{"Memory type :"+[char]9 +[char]9 + "Other"+[char]10}
2
{"Memory type :"+[char]9 +[char]9 + "DRAM"+[char]10}
3
{"Memory type :"+[char]9 +[char]9 + "Synchronous DRAM"+[char]10}
4
{"Memory type :"+[char]9 +[char]9 + "Cache DRAM"+[char]10}
5
{"Memory type :"+[char]9 +[char]9 + "EDO"+[char]10}
6
{"Memory type :"+[char]9 +[char]9 + "vEDRAM"+[char]10}
7
{"Memory type :"+[char]9 +[char]9 + "VRAM"+[char]10}
8
{"Memory type :"+[char]9 +[char]9 + "SRAM"+[char]10}
9
{"Memory type :"+[char]9 +[char]9 + "ROM"+[char]10}
10
{"Memory type :"+[char]9 +[char]9 + "ROM"+[char]10}
11
{"Memory type :"+[char]9 +[char]9 + "FLASH"+[char]10}
12
{"Memory type :"+[char]9 +[char]9 + "EEPROM"+[char]10}
13
{"Memory type :"+[char]9 +[char]9 + "FEPROM"+[char]10}
14
{"Memory type :"+[char]9 +[char]9 + "EPROM"+[char]10}
15
{"Memory type :"+[char]9 +[char]9 + "CDRAM"+[char]10}
16
{"Memory type :"+[char]9 +[char]9 + "3DRAM"+[char]10}
17
{"Memory type :"+[char]9 +[char]9 + "SDRAM"+[char]10}
18
{"Memory type :"+[char]9 +[char]9 + "SGRAM"+[char]10}
19
{"Memory type :"+[char]9 +[char]9 + "RDRAM"+[char]10}
20
{"Memory type :"+[char]9 +[char]9 + "DDR"+[char]10}
21
{"Memory type :"+[char]9 +[char]9 + "DDR2" +[char]10}
22
{"Memory type :"+[char]9 +[char]9 + "DDR2 FB-DIMM"}
24
{"Memory type :"+[char]9 +[char]9 + "DDR3" +[char]10 }
25
{"Memory type :"+[char]9 +[char]9 + "FBD2" +
[char]10}
default
{"The type could not be determined."}
}
}
========================================
Sample
output:
Caption : Physical Memory
Speed : 533ns
Serial number : 08A90100
Capacity : 4096MB
Memory type : DDR3
Caption : Physical Memory
Speed : 533ns
Serial number : FB4F9302
Capacity : 2048MB
Memory type : DDR3
Comments
Post a Comment