2013-07-18 24 views
1

我正在寻找一个解决方案单个值,我想我的免费存储空间,如MB单个值。输出可用内存为兆字节

当我如出文件,我总是得到一次科技咨询等

我wheter我们通过GET-计数器得到的结果还是让-WmiObject可以没关系。

我尝试了这种方式和OFC我总是得到完整的消息outfiled ...

get-wmiobject win32_operatingSystem FreephysicalMemory 

Get-Counter -Counter "\Memory\Available MBytes" 

预先感谢您!

射线

回答

3
$mem = Get-Counter -Counter "\Memory\Available MBytes" 
$mem.CounterSamples[0].CookedValue 

# FreephysicalMemory is represented in kb, devide it in 1kb to get the value in mb 
(get-wmiobject win32_operatingSystem FreephysicalMemory).FreePhysicalMemory/1kb 
+0

非常感谢你,再来一次,你取得了:) – RayofCommand

相关问题