21 lines
388 B
PowerShell
21 lines
388 B
PowerShell
# PowerShell profile script
|
|
|
|
filter Add-Runtime {
|
|
<#
|
|
.SYNOPSIS
|
|
Add Runtime property to each process object in pipeline
|
|
|
|
.EXAMPLE
|
|
ps *mosh* | Add-Runtime | ft Name,StartTime,Status
|
|
#>
|
|
|
|
$_ | Add-Member -PassThru -NotePropertyName Runtime -NotePropertyValue (New-TimeSpan -Start $_.StartTime)
|
|
}
|
|
|
|
function ps {
|
|
Get-Process @args | Add-Runtime
|
|
}
|
|
|
|
Set-Alias kill Stop-Process
|
|
|