PoshCode Archive  Artifact [0be5a4dbf4]

Artifact 0be5a4dbf4eb9fc47ce46ab9be9d4de2c521aa0efb31e1f36c7382e02c7640cf:

  • File Get-Process-eq-PSList.ps1 — part of check-in [0bc0540fb6] at 2018-06-10 13:35:00 on branch trunk — You can sort Get-Process cmdlet output in PSList style, of course if you has administrator privileges :) [My original post] (http://my.opera.com/samplez/blog/2013/03/18/get-process-eq-pslist) (user: greg zakharov size: 678)

# encoding: ascii
# api: powershell
# title: Get-Process -eq PSList
# description: You can sort Get-Process cmdlet output in PSList style, of course if you has administrator privileges :) [My original post] (http://my.opera.com/samplez/blog/2013/03/18/get-process-eq-pslist)
# version: 0.1
# author: greg zakharov
# license: CC0
# x-poshcode-id: 4028
# x-archived: 2013-03-21T06:25:37
# x-published: 2013-03-18T17:44:00
#
#
ps | % -b {$arr = @()} -p {
  $str = "" | select Name, PID, Time
  $str.Name = $_.ProcessName
  $str.PID  = $_.Id
  $str.Time = $(try {$_.StartTime} catch {return [DateTime]::MinValue})
  $arr += $str
} -end {$arr | sort Time | ft -a}