diff --git a/conf/Microsoft.PowerShell_profile.ps1 b/conf/Microsoft.PowerShell_profile.ps1 index 6486964..ea08367 100644 --- a/conf/Microsoft.PowerShell_profile.ps1 +++ b/conf/Microsoft.PowerShell_profile.ps1 @@ -1,11 +1,20 @@ # PowerShell profile script -Set-Alias ps Get-Process -Set-Alias kill Stop-Process - -# ex: ps *mosh* | Add-Runtime | ft Name,StartTime,Status - filter Add-Runtime { - $_ | Add-Member -PassThru -NotePropertyName Status -NotePropertyValue (New-TimeSpan -Start $_.StartTime) + <# + .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 +