Files
linux-workspace/conf/Microsoft.PowerShell_profile.ps1
2020-10-02 08:06:06 +02:00

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