在PowerShell中获取本地的RAM信息(容量)

  您可以通过一些内置的系统信息工具或各种第三方系统库存实用程序(如CPU-Z或AIDA32)获取有关计算机上安装的RAM的信息。
  但在这里,我将讨论如何使用PowerShell(Windows附带的内置脚本工具)从本地和远程计算机中提取相同的信息

有多少内存插槽

  Get-WmiObject -class "Win32_PhysicalMemoryArray"

  

  MemoryDevices列指示计算机上有多少可用内存插槽,而MaxCapacity指示您可以安装多少RAM。

  要从远程计算机获取信息,请使用-computername 

  Get-WmiObject -class "Win32_PhysicalMemoryArray" -ComputerName Server02

查看当前内存容量

Get-WmiObject Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum

  

原文地址:https://www.cnblogs.com/feiyucha/p/11172287.html