컴퓨터에 메모리 종류 확인

-- PowerShell 2011. 6. 24. 13:25
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

컴퓨터에 메모리를 확인할 때, CPU-Z나 Everlast 같은 유틸리티를 사용하곤 한다.
PowerShell로 이런 것을 확인하는 스크립트를 만들면 어떨까해서 만들어 봤다.

Function GetTypeName([int] $intType)
{
    switch($intType)
    {
        0 {"Unknown"}
        1 {"Other"}
        2 {"DRAM"}
        3 {"Synchronous DRAM"}
        4 {"Cache DRAM"}
        5 {"EDO"}
        6 {"EDRAM"}
        7 {"VRAM"}
        8 {"SRAM"}
        9 {"RAM"}
        10 {"ROM"}
        11 {"Flash"}
        12 {"EEPROM"}
        13 {"FEPROM"}
        14 {"EPROM"}
        15 {"CDRAM"}
        16 {"3DRAM"}
        17 {"SDRAM"}
        18 {"SGRAM"}
        19 {"RDRAM"}
        20 {"DDR"}
        21 {"DDR-2"}
        default {""}
    }
}

<#
Get-wmiobject -query "Select * from CIM_PhysicalMemory" |`
Format-Table name, DeviceLocator, Capacity, DataWidth, Speed, MemoryType -auto
#>

$objMemInfos = Get-wmiobject -query "Select * from CIM_PhysicalMemory"

foreach ($objMemInfo in $objMemInfos)
{
    Write-Host $objMemInfo.DeviceLocator ":" $($objMemInfo.Capacity / 1MB) $(GetTypeName($objMemInfo.MemoryType)) ", DataWidth : "  $objMemInfo.DataWidth "Speed :" $objMemInfo.Speed
}

GetMemoryInfo.ps1

posted by 어린왕자악꿍