fix: call Set-PoshContext first

resolves #103
This commit is contained in:
Jan De Dobbeleer 2020-10-27 12:17:24 +01:00 committed by Jan De Dobbeleer
parent 33c40ebf39
commit ab0a415a3b

View file

@ -45,6 +45,7 @@ function Set-PoshPrompt {
[ScriptBlock]$Prompt = { [ScriptBlock]$Prompt = {
$realLASTEXITCODE = $global:LASTEXITCODE $realLASTEXITCODE = $global:LASTEXITCODE
Set-PoshContext
if ($realLASTEXITCODE -isnot [int]) { if ($realLASTEXITCODE -isnot [int]) {
$realLASTEXITCODE = 0 $realLASTEXITCODE = 0
} }
@ -62,7 +63,6 @@ function Set-PoshPrompt {
} }
$process = New-Object System.Diagnostics.Process $process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo $process.StartInfo = $startInfo
Set-PoshContext
$process.Start() | Out-Null $process.Start() | Out-Null
$standardOut = $process.StandardOutput.ReadToEnd() $standardOut = $process.StandardOutput.ReadToEnd()
$process.WaitForExit() $process.WaitForExit()