如何在powershell中找到计算机可以扩展的最大RAM。我尝试使用
$colItems3 = get-wmiobject -class "Win32_OperatingSystem"
但答案不正确
如何在powershell中找到计算机可以扩展的最大RAM。我尝试使用
$colItems3 = get-wmiobject -class "Win32_OperatingSystem"
但答案不正确
对于您想要的已安装 RAM:
Get-WmiObject Win32_PhysicalMemory | Where {$_.MemoryType -ge 20} |
Measure Capacity -sum
查看此MSDN 页面以获取有关 MemoryType 的更多信息。
对于系统将处理的最大 RAM 量,我认为这应该能让你做到这一点。但是,我认为这并不意味着操作系统或主板一定会处理那么多内存。我在 Win32_MotherboardDevice 上看不到任何显示最大 RAM 的内容。
Get-WmiObject Win32_PhysicalMemoryArray | Where {$_.Use -eq 3} |
Foreach {($_.MaxCapacity*1KB)/1GB}
$colItems3 = get-wmiobject -class "win32_PhysicalMemoryArray" -computername $strComputer
foreach ($objItem3 in $colItems3)
{
$e3=($colItems3.MemoryDevices)* 2
write-host "Free Physical Memory : " $e3 'GB'
}
这是不正确的,但至少接近一个
尝试:gwmi Win32_OperatingSystem | % {$_.MaxProcessMemorySize / 1MB}
在 Powershell.exe 中