#10908 added a -MaskInput switch to Read-Host to allow reading sensitive input from the user. However, when used with -Prompt, the -MaskInput switch is no longer in effect thus showing what the user is typing.
Steps to reproduce
read-host -MaskInput -Prompt "Tell me your secret"
Expected behavior
Tell me your secret: ****
Actual behavior
Tell me your secret: test
Environment data
Name Value
---- -----
PSVersion 7.1.0-preview.3
PSEdition Core
GitCommitId 7.1.0-preview.3-90-g3d003cb227ebe165d450f558ea48876473050086
OS Darwin 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
#10908 added a
-MaskInputswitch toRead-Hostto allow reading sensitive input from the user. However, when used with-Prompt, the-MaskInputswitch is no longer in effect thus showing what the user is typing.Steps to reproduce
Expected behavior
Actual behavior
Environment data