Difference between revisions of "Get-counter"
Jump to navigation
Jump to search
Line 33: | Line 33: | ||
https://stackoverflow.com/questions/51745651/powershell-script-list-process-with-cpu-memory-disk-usage | https://stackoverflow.com/questions/51745651/powershell-script-list-process-with-cpu-memory-disk-usage | ||
+ | |||
+ | ``` | ||
+ | Get-CimInstance -ClassName Win32_Process | Format-List -Property * | ||
+ | |||
+ | ``` |
Revision as of 20:45, 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
Get-CimInstance -ClassName Win32_Process | Format-List -Property *