简体   繁体   中英

How to get Total CPU usage percentage without instance name in powershell

Get-WmiObject Win32_Processor | Measure-Object -Property LoadPercentage -Average | Select Average
I will get output like

Average
-----------
30
how can i get that value 30 only.

To get just the value, ccess the Average propert of Measure-Object 's output. No need to pipe the results to Select-Object at all. Like so,

(Get-WmiObject Win32_Processor | Measure-Object -Property LoadPercentage -Average).Average
8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM