- This will give the current queue length: Get-Counter -Counter “\System\Processor Queue Length”
- This will give the average utilization of your CPU: “Average CPU Usage per 10 samples: $([math]::round((get-counter -Counter “\Processor(_Total)\% Processor Time” -SampleInterval 1 -MaxSamples 10 | select -ExpandProperty countersamples | select -ExpandProperty cookedvalue | Measure-Object -Average).average,2))%”
- This will give you the top processes that is taking too much of your CPU’s memory: get-wmiobject Win32_PerfFormattedData_PerfProc_Process |?{$_.name -ne “_Total” -and $_.name -ne “Idle” -and $_.percentprocessortime -ge 10} |select @{n=”Application”;e={$_.name}},@{n=”CPU”;e={$_.PercentProcessorTime}} | Sort-Object CPU -Descending | ft -auto
Leave a Reply