You can use this simple command to query CPU utilization of local/remote machine with PowerShell. This is really useful for troubleshooting issues. Enjoy…
Get-Counter -ComputerName "RemotePC" '\Processor(*)\% Processor Time' -Continuous -SampleInterval 5
This queries remote computer CPU usage for every 5 seconds continously.
If you want to query the local computer CPU utilization, simply use below command.
Get-Counter '\Processor(*)\% Processor Time' -Continuous -SampleInterval 5
Hope you liked it.