From 767e8e7bcf989f105fffd436561c79eace80df13 Mon Sep 17 00:00:00 2001 From: "L. Yeung" Date: Sat, 23 Jul 2022 18:47:01 +0800 Subject: [PATCH] fix(pwsh): run command corretly in Constrained Language mode --- src/shell/scripts/omp.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shell/scripts/omp.ps1 b/src/shell/scripts/omp.ps1 index 8821b2b4..2a86990c 100644 --- a/src/shell/scripts/omp.ps1 +++ b/src/shell/scripts/omp.ps1 @@ -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 }