Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the console for WinRM remoting #86

Merged
merged 1 commit into from
Dec 15, 2022

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