powershellquery-optimizationwindbgremote-serverpowershell-4.0

Details of a thread in Powershell


How can I get the CPU consumption of all threads running in a process thru powershell, in a format similar to this

enter image description here

I can't find any processor information when I run gwmi win32_thread|select -First 1. And the Start Address is numeric !?!


Solution

  • This is working fine with PowerShell 7.3.3

    (Get-Process -ProcessName taskmgr).Threads|Sort-Object TotalProcessorTime -Descending| 
        Format-Table -Property Id,PriorityLevel,ThreadState,WaitReason,StartTime,TotalProcessorTime
    

    Output

    enter image description here