I came up with following to get CPU% of top 10 process. this can be useful to you as well.
$CpuCores = (Get-WMIObject Win32_ComputerSystem).NumberOfLogicalProcessors
(Get-Counter "\Process(*)\% Processor Time").CounterSamples | Select InstanceName,
@{Name="CPU %";Expression={[Decimal]::Round(($_.CookedValue / $CpuCores), 2)}} |
sort *CPU* -Descending | select -First 10
sort *CPU* -Descending | select -First 10
Comments
Post a Comment