get-wmiobject win32_physical memory count

时间:2013-12-09 14:14:42

标签: powershell

我使用以下脚本:

get-wmiobject -class win32_physicalmemory | select Name, Model, Speed, Capacity, DeviceLocator

并且输出列出了4块内存,但我想要做的是计算物理内存的数量,然后列出模型,速度,容量和设备定位器。

我尝试过使用:

(get-wmiobject -class win32_physicalmemory | select Name, Model, Speed, Capacity, DeviceLocator).count

但这只会返回4,而不是4 其他属性。

1 个答案:

答案 0 :(得分:1)

您总是可以分两部分来完成:

$mem = get-wmiobject -class win32_physicalmemory | select Name, Model, Speed, Capacity, DeviceLocator
"Count is $($mem.count)"
$mem
相关问题