问题描述
我有这个:
(Get-WMIObject Win32_logicaldisk -computername computer).TotalPhysicalMemory
获取远程计算机上安装的物理内存大小.我如何获得那台计算机的免费内存?
to get size of physical memory installed on remote computer.How do I get the FREE memory of that computer?
我试过了
(Get-WMIObject Win32_logicaldisk -computername computer).FreePhysicalMemory
和其他一些变体,但没有效果.是否有一些可能的过滤器"列表?
and some other variants, but with no effect. Is there some list of possible "filters"?
推荐答案
无论何时您想查看对象的所有属性,都可以将其通过管道传输到 Format-List *
.
Whenever you want to see all of the properties of an object, pipe it to Format-List *
.
Get-WmiObject Win32_LogicalDisk | format-list *
Get-WmiObject Win32_OperatingSystem | fl *
或者如果您正在寻找特定的属性,您可以使用通配符搜索
Or if you are looking for a particular propery, you can use wildcard search
Get-WmiObject Win32_OperatingSystem | fl *free*
正如 Aquinas 所说,您需要 Win32_OperatingSystem
类、FreePhysicalMemory
属性.Win32_LogicalDisk
跟踪硬盘,而不是 RAM.
As Aquinas says, you want the Win32_OperatingSystem
class, FreePhysicalMemory
property. Win32_LogicalDisk
tracks hard disks, not RAM.
这篇关于如何使用 PowerShell 获取远程计算机的可用物理内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!