fix(pwsh): run command corretly in Constrained Language mode

This commit is contained in:
L. Yeung 2022-07-25 09:31:49 +08:00 committed by Jan De Dobbeleer
parent 210e9918de
commit c5e77f8790

View file

@ -35,7 +35,7 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
)
if ($ExecutionContext.SessionState.LanguageMode -eq "ConstrainedLanguage") {
$standardOut = Invoke-Expression "& '$FileName' `$Arguments 2>&1"
$standardOut = Invoke-Expression "& `$FileName `$Arguments 2>&1"
$standardOut -join "`n"
return
}