Fix Get-Credential to not prompt twice when no parameter is specified#2330
Fix Get-Credential to not prompt twice when no parameter is specified#2330lzybkr merged 1 commit intoPowerShell:masterfrom
Conversation
|
Hi @daxian-dbw, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
|
@lzybkr can you please review this PR? Thanks! |
lzybkr
left a comment
There was a problem hiding this comment.
You know it's weird that we rely on the parameter binder to do the prompting if no arguments are passed, but the prompting is done here if there are arguments.
For example, I get the extra prompting:
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
If I don't specify parameters. This isn't the best user experience, but as it is, I'd recommend always using -Message to avoid that extra text.
There was a problem hiding this comment.
You could merge this with the previous Match.
|
The |
|
Of course - but I'm asking a different question - can we get the same effect of prompting in For example, if we changed the default message/title in But really - I'm just saying we should be seeing the parameter binding prompts when asking the user for a credential. Ever. |
|
Got @lzybkr 's point now. The current change gives inconsistent prompting experience for This is because for |
e08b197 to
a7abd32
Compare
|
@daxian-dbw Please take a look #2315 |
|
I approve this fix 👍 But why not move the last writeobject to the try ? |
|
@McAndersDK it's to avoid a very very rare edge case -- |
|
@lzybkr The PR has been updated to address your comments. Please take another look when you have time. Thanks! |
Fix #2306