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 “RemotePCName” ‘\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’ -Continuos -SampleInterval 5

Hope you liked it.

Other posts