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

This commit is contained in:
L. Yeung 2022-07-23 18:47:01 +08:00 committed by Jan De Dobbeleer
parent 729858377b
commit 767e8e7bcf

View file

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