Difference between revisions of "Get-counter"
Jump to navigation
Jump to search
Line 25: | Line 25: | ||
``` | ``` | ||
Get-Counter '\Process(*)\% Processor Time' | Select-Object -ExpandProperty countersamples| Select-Object -Property instancename, cookedvalue| ? {$_.instanceName -notmatch "^(idle|_total|system)$"} | Sort-Object -Property cookedvalue -Descending| Select-Object -First 25| ft InstanceName,@{L='CPU';E={($_.Cookedvalue/100/$env:NUMBER_OF_PROCESSORS).toString('P')}} -AutoSize | Get-Counter '\Process(*)\% Processor Time' | Select-Object -ExpandProperty countersamples| Select-Object -Property instancename, cookedvalue| ? {$_.instanceName -notmatch "^(idle|_total|system)$"} | Sort-Object -Property cookedvalue -Descending| Select-Object -First 25| ft InstanceName,@{L='CPU';E={($_.Cookedvalue/100/$env:NUMBER_OF_PROCESSORS).toString('P')}} -AutoSize | ||
+ | ``` | ||
+ | |||
+ | |||
+ | ``` | ||
+ | Get-Process | Sort-Object -Property 'CPU' -Descending | Select-Object -First 10 | ||
``` | ``` |
Revision as of 20:36, 16 July 2022
get-counter '\Process(*)\IO Read Bytes/sec' | Format-List Get-Counter '\Processor(_Total)\% Processor Time' Get-Counter '\Memory\Available MBytes' (Get-Counter '\Process(*)\% Processor Time').CounterSamples | Where-Object {$_.CookedValue -gt 5} Get-Process winword, explorer | Format-List *
https://adamtheautomator.com/powershell-get-process/
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/tasklist
Get-Counter '\Process(*)\% Processor Time' | Select-Object -ExpandProperty countersamples| Select-Object -Property instancename, cookedvalue| ? {$_.instanceName -notmatch "^(idle|_total|system)$"} | Sort-Object -Property cookedvalue -Descending| Select-Object -First 25| ft InstanceName,@{L='CPU';E={($_.Cookedvalue/100/$env:NUMBER_OF_PROCESSORS).toString('P')}} -AutoSize
Get-Process | Sort-Object -Property 'CPU' -Descending | Select-Object -First 10