From 8a19b7b177fa1f6c3e866033b0c37ca67ea6d87e Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL)" Date: Fri, 14 May 2021 07:16:31 -0700 Subject: [PATCH] Use AllocConsole before initializing CLR to ensure console is attached --- src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp b/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp index c126373..d2e56e5 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp @@ -37,6 +37,8 @@ unsigned int PowerShellCoreClrWorker::LaunchClr( _In_ LPCWSTR wszRuntimeVersion, _In_ LPCSTR friendlyName) { + // Allocate a console so that the codepage is setup correctly + AllocConsole(); return commonLib->LaunchCoreCLR(hostWrapper, hostEnvironment, friendlyName); }