July 2011
Intermediate to advanced
480 pages
11h 54m
English
One of the best ways to monitor CPU utilization with PowerShell is by querying performance counters. We can also get this information using WMI. In this recipe, you'll learn a few techniques that can be used to monitor CPU utilization using the Get-Counterand Get-WmiObject cmdlets.
Processor(_Total)\% Processor Time performance counter:Get-Counter "\Processor(_Total)\% Processor Time" -Continuous
This would continuously output the total utilization across each CPU, as shown:

Win32_Processor class ...