How do I get total physical memory size using PowerShell without WMI?

后端 未结 8 1819
暖寄归人
暖寄归人 2020-12-31 04:12

I\'m trying to get the physical memory size using PowerShell, but without using get-wmiobject.

I have been using the following PS cmdlet to get the physical memory s

8条回答
  •  鱼传尺愫
    2020-12-31 04:29

    This gives you the total amount from another WMI class:

    $cs = get-wmiobject -class "Win32_ComputerSystem"
    $Mem = [math]::Ceiling($cs.TotalPhysicalMemory / 1024 / 1024 / 1024)
    

    Hope this helps.

提交回复
热议问题