Skip to content

Adds Mask Input Parameter to Read-Host - #10908

Merged
Travis Plunk (TravisEz13) merged 13 commits into
PowerShell:masterfrom
davinci26:feat/maskedInput
May 28, 2020
Merged

Adds Mask Input Parameter to Read-Host#10908
Travis Plunk (TravisEz13) merged 13 commits into
PowerShell:masterfrom
davinci26:feat/maskedInput

Conversation

@davinci26

@davinci26 Sotiris Nanopoulos (davinci26) commented Oct 27, 2019

Copy link
Copy Markdown
Contributor

PR Summary

Issue

Adds #10847

Implementation

  • Extend the PSHostUserInterface class with a virtual method ReadLineMaskedAsString. This method is in between ReadLine and ReadLineAsSecureString.
  • Implement the new method in the InternalHostUserInterface.cs
  • I provided a default implementation in the Interface which just throws an exception to make this change backward compatible.
  • Check at runtime if the user has provided both -MaskInput and -AsSecureString and if so throw an exception. Use parameter sets to make -MaskInput and -AsSecureString mutually exclusive (this is another application for Parameters Should Support Mutual Exclusion Natively #5175)

Happy Hacktoberfest!

PR Context

PR Checklist

  • Testing - New and feature
  • Tooling
    • I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    • OR
    • I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
      • Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host).
      • Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
      • Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
      • Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

@davinci26 Sotiris Nanopoulos (davinci26) changed the title WiP: Adds Mask Input Parameter to Read-Host Adds Mask Input Parameter to Read-Host Oct 28, 2019
Comment thread src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs Outdated
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 29, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 29, 2019
Comment thread src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs Outdated
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 30, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 30, 2019
Comment thread src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs Outdated
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 30, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 31, 2019
@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 31, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Oct 31, 2019
@SteveL-MSFT Steve Lee (SteveL-MSFT) added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Nov 20, 2019
@SteveL-MSFT

Copy link
Copy Markdown
Member

@PowerShell/powershell-committee reviewed this and is ok with the proposed switch name and functionality.

@SteveL-MSFT

Copy link
Copy Markdown
Member

Sotiris Nanopoulos (@davinci26) can you resolve the merge conflict?

@davinci26

Copy link
Copy Markdown
Contributor Author

PoshChan-Bot (@PoshChan) please retry windows and static

@PoshChan

Copy link
Copy Markdown
Collaborator

Sotiris Nanopoulos (@davinci26), you are not authorized to request a rebuild

@davinci26

Copy link
Copy Markdown
Contributor Author

Steve Lee (@SteveL-MSFT) FYI I have fixed all merge conflicts.

@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Mainainer, Please provide feedback and/or mark it as Waiting on Author

@iSazonov

Copy link
Copy Markdown
Collaborator

Travis Plunk (@TravisEz13) It seems the PR ready to merge.

@TravisEz13 Travis Plunk (TravisEz13) changed the title Adds Mask Input Parameter to Read-Host Adds Mask Input Parameter to Read-Host May 28, 2020
@TravisEz13
Travis Plunk (TravisEz13) merged commit d26e8c0 into PowerShell:master May 28, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

Sotiris Nanopoulos (@davinci26) Thanks for your contribution!

@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.4 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
Co-authored-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants