diff --git a/packages/powershell/go-my-posh/go-my-posh.psm1 b/packages/powershell/go-my-posh/go-my-posh.psm1 index 385586ca5977..30a01bf3854d 100644 --- a/packages/powershell/go-my-posh/go-my-posh.psm1 +++ b/packages/powershell/go-my-posh/go-my-posh.psm1 @@ -86,8 +86,9 @@ function Get-PoshThemes { } function Write-PoshTheme { + $config = $global:PoshSettings.Theme $poshCommand = Get-PoshCommand - Invoke-Expression -Command "$poshCommand -print-config" + & $poshCommand -config $config -print-config } # Helper function to create argument completion results