-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Change Read-Host -MaskInput
to use existing SecureString path, but return as plain text
#13256
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
Conversation
…eturn as plain text
Read-Host -MaskInput
to use existig SecureString path, but return as plain textRead-Host -MaskInput
to use existing SecureString path, but return as plain text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The host change makes me think we should have more SDK tests, particularly a test host implementation, so we have a good litmus test for breaking changes in the API surface
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs
Outdated
Show resolved
Hide resolved
@PoshChan please retry macos |
@SteveL-MSFT, did not find matching build context: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for one minor comment.
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs
Outdated
Show resolved
Hide resolved
@SteveL-MSFT Can you please resolve the conflict? mac CI failing tests are marked as pending for now, so CI should pass after you rebase. |
@PoshChan Please remind me in 1 hour |
@daxian-dbw, this is the reminder you requested 1 hour ago |
🎉 Handy links: |
PR Summary
#10908 introduced a new
-MaskInput
switch to enable hiding the input while still returning a string. It did this by introducing a new methodReadLineMaskedAsString()
, however, this was not necessary and would not be supported by remoting as it required hosts to implement it. It also did not support use of-MaskInput
with-Prompt
.The change here is to revert most of the changes in that PR to instead use existing
ReadLineAsSecureString()
method which would already be implemented by different hosts and convert to a string if-MaskInput
is used.PR Context
Fix #13011
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.