Skip to content

Commit 06d8c01

Browse files
authored
Hide the console for WinRM remoting (#86)
1 parent 6280a69 commit 06d8c01

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ unsigned int PowerShellCoreClrWorker::LaunchClr(
3939
{
4040
// Allocate a console so that the codepage is setup correctly
4141
AllocConsole();
42+
HWND console = GetConsoleWindow();
43+
if (console != NULL)
44+
{
45+
// Hide the console window
46+
ShowWindow(console, SW_HIDE);
47+
}
48+
4249
return commonLib->LaunchCoreCLR(hostWrapper, hostEnvironment, friendlyName);
4350
}
4451

0 commit comments

Comments
 (0)