While(1) {ps | sort -des cpu | select -f 15 | ft -a; sleep 1; cls}
This is a simple one liner-liner that will also keep the labels at the top.:
While(1) {ps | sort -des cpu | select -f 15 | ft -a; sleep 1; cls}
This works because formatting the table without any parameters just drawls the default table. autosizeautosize
is used to automatically adjust the column width so all the data can fit on screen.
Here is a breakdownBreakdown of the shortened commands used:
- select -f is a
select -f
: shortcut for -first-first
- ft is a
ft
: shortcut for Format-TableFormat-Table
- -a is a
-a
: shortcut for -autosize-autosize
- sleep
sleep
: defaults to using seconds