fix(pwsh): invoke module support before context

relates to #655
This commit is contained in:
Jan De Dobbeleer 2021-04-17 20:35:20 +02:00 committed by Jan De Dobbeleer
parent 52f260caf6
commit 016d981baa

View file

@ -54,6 +54,7 @@ function global:Initialize-ModuleSupport {
#store the last exit code for restore #store the last exit code for restore
$realLASTEXITCODE = $global:LASTEXITCODE $realLASTEXITCODE = $global:LASTEXITCODE
$errorCode = 0 $errorCode = 0
Initialize-ModuleSupport
Set-PoshContext Set-PoshContext
if ($lastCommandSuccess -eq $false) { if ($lastCommandSuccess -eq $false) {
#native app exit code #native app exit code
@ -80,7 +81,6 @@ function global:Initialize-ModuleSupport {
$executionTime = ($history.EndExecutionTime - $history.StartExecutionTime).TotalMilliseconds $executionTime = ($history.EndExecutionTime - $history.StartExecutionTime).TotalMilliseconds
$global:omp_lastHistoryId = $history.Id $global:omp_lastHistoryId = $history.Id
} }
Initialize-ModuleSupport
$omp = "::OMP::" $omp = "::OMP::"
$config = $global:PoshSettings.Theme $config = $global:PoshSettings.Theme
$cleanPWD = $PWD.ProviderPath.TrimEnd("\") $cleanPWD = $PWD.ProviderPath.TrimEnd("\")