title: Powershell command to sort processes based on thread count
body: <p>I'm trying to write a script that will list all active processes with the amount of threads they are using and then sort them from most threads to least.</p>
  
  <p>What I have currently is hacked together and doesn't sort on active threads:</p>
  
  <pre><code>get-process | %{$_.Name;$_.Threads | %{$_.ID }| measure-object -line}
  </code></pre>
  
  <p>Anyone know of a better way to go about this? </p>