File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/powershell/oh-my-posh Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -234,8 +234,8 @@ Edit `$PROFILE` in your preferred PowerShell version and add the following lines
234234
235235 $executionTime = -1
236236 $history = Get-History -ErrorAction Ignore -Count 1
237- if ($null -ne $history -and $null -ne $history.Duration ) {
238- $executionTime = $history.Duration .TotalMilliseconds
237+ if ($null -ne $history -and $null -ne $history.EndExecutionTime -and $null -ne $history.StartExecutionTime ) {
238+ $executionTime = ( $history.EndExecutionTime - $history.StartExecutionTime) .TotalMilliseconds
239239 }
240240
241241 $startInfo = New-Object System.Diagnostics.ProcessStartInfo
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ function Set-PoshPrompt {
7474
7575 $executionTime = -1
7676 $history = Get-History - ErrorAction Ignore - Count 1
77- if ($null -ne $history -and $null -ne $history.Duration ) {
78- $executionTime = $history.Duration .TotalMilliseconds
77+ if ($null -ne $history -and $null -ne $history.EndExecutionTime -and $null -ne $history .StartExecutionTime ) {
78+ $executionTime = ( $history.EndExecutionTime - $history .StartExecutionTime ) .TotalMilliseconds
7979 }
8080
8181 $startInfo = New-Object System.Diagnostics.ProcessStartInfo
You can’t perform that action at this time.
0 commit comments