Add Add-Runtime to PowerShell

This commit is contained in:
Martin Blazik
2020-10-01 19:33:19 +02:00
parent 54b386c07c
commit d247df9a90
2 changed files with 6 additions and 3 deletions

View File

@@ -3,7 +3,9 @@
Set-Alias ps Get-Process Set-Alias ps Get-Process
Set-Alias kill Stop-Process Set-Alias kill Stop-Process
function uptime() { # ex: ps *mosh* | Add-Runtime | ft Name,StartTime,Status
((Get-Date) - (gcim Win32_OperatingSystem).LastBootUpTime)
filter Add-Runtime {
$_ | Add-Member -PassThru -NotePropertyName Status -NotePropertyValue (New-TimeSpan -Start $_.StartTime)
} }

View File

@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
set -e
set -u
set -x set -x
set -o
PWSH_PROFILE_NAME=Microsoft.PowerShell_profile.ps1 PWSH_PROFILE_NAME=Microsoft.PowerShell_profile.ps1
PWSH_PROFILE_PATH=$HOME/.config/powershell/ PWSH_PROFILE_PATH=$HOME/.config/powershell/