Skip to content

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

The change to allocate a console so that the codepage is set correctly had the side effect of showing the console. This change was deemed least risky to hide the console immediately. Downside is there can be a flash of the console, but we can consider other fixes longer term with proper validation while this is needed to be backported to 7.3

PR Context

Fix #85

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhan adityapatwardhan merged commit 06d8c01 into PowerShell:master Dec 15, 2022
@@ -39,6 +39,13 @@ unsigned int PowerShellCoreClrWorker::LaunchClr(
{
// Allocate a console so that the codepage is setup correctly
AllocConsole();
HWND console = GetConsoleWindow();
if (console != NULL)
Copy link
Contributor

@iSazonov iSazonov Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AllocateConsole returns HWND and since winrm haven't a console before the call returns real handle. It seems we have no need to call GetConsoleWindows.
https://learn.microsoft.com/en-us/windows/console/allocconsole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New-PSSession throws a black window named 'c:\windows\system32\wsmprovhost.exe'
4 participants