mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat: execution time for powershell 5
This commit is contained in:
parent
85b1fc2662
commit
21f01d69e8
|
@ -234,8 +234,8 @@ Edit `$PROFILE` in your preferred PowerShell version and add the following lines
|
|||
|
||||
$executionTime = -1
|
||||
$history = Get-History -ErrorAction Ignore -Count 1
|
||||
if ($null -ne $history -and $null -ne $history.Duration) {
|
||||
$executionTime = $history.Duration.TotalMilliseconds
|
||||
if ($null -ne $history -and $null -ne $history.EndExecutionTime -and $null -ne $history.StartExecutionTime) {
|
||||
$executionTime = ($history.EndExecutionTime - $history.StartExecutionTime).TotalMilliseconds
|
||||
}
|
||||
|
||||
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||
|
|
|
@ -74,8 +74,8 @@ function Set-PoshPrompt {
|
|||
|
||||
$executionTime = -1
|
||||
$history = Get-History -ErrorAction Ignore -Count 1
|
||||
if ($null -ne $history -and $null -ne $history.Duration) {
|
||||
$executionTime = $history.Duration.TotalMilliseconds
|
||||
if ($null -ne $history -and $null -ne $history.EndExecutionTime -and $null -ne $history.StartExecutionTime) {
|
||||
$executionTime = ($history.EndExecutionTime - $history.StartExecutionTime).TotalMilliseconds
|
||||
}
|
||||
|
||||
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||
|
|
Loading…
Reference in a new issue