[英]How to get Total CPU usage percentage without instance name in powershell
Get-WmiObject Win32_Processor |获取 WmiObject Win32_Processor | Measure-Object -Property LoadPercentage -Average |
Measure-Object -Property LoadPercentage -Average | Select Average
Select 平均
I will get output like我会得到 output 之类的
Average平均
----------- ------------
30 30
how can i get that value 30 only.我怎样才能得到这个值 30 只有。
To get just the value, ccess the Average
propert of Measure-Object
's output.要获得该值,请访问
Measure-Object
的 output 的Average
属性。 No need to pipe the results to Select-Object
at all.根本不需要 pipe 结果到
Select-Object
。 Like so,像这样,
(Get-WmiObject Win32_Processor | Measure-Object -Property LoadPercentage -Average).Average
8
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.