Change "message" in Get-Credential to mandatory#2315
Change "message" in Get-Credential to mandatory#2315iSazonov wants to merge 5 commits intoPowerShell:masterfrom iSazonov:getcredential
Conversation
Change "message" in Get-Credential to mandatory
|
Hi @iSazonov, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Change test to check mandatory message parameter
Check exception ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetCredentialCommand
|
@lzybkr Please take a look. I think you have been dealing with the iterations of this issue. |
|
Clear about #2306. I removed Close #2306.
I believe that this PR #2315 must be accepted before #2330, because in #2330 already added tests (for "It "Get-Credential without parameters" { " and so on) - @daxian-dbw made unnecessary work. I update fist comment of the PR with arguments. |
|
I tried the changes made by @daxian-dbw - I think it provides exactly the experience we want without making Having a mandatory parameter in a parameter set is a guideline, not a requirement. In this specific case, there are benefits to not making And correct me if I'm wrong, but are there really compatibility issues? All previous versions of PowerShell support calling |
|
I revoke "compatibility" statement. In previous versions, an user only receives one more question, but a script will work.
Yes, it is not a requirement but the guide says about best practice for script writer that comes from the best user experience. But! I was very conservative. I modeled various combinations of parameters (default and non-default, localized and non-localized) and think that as best practice the script writers will have to specify the message and title in a pair without the requirement that message is mandatory. So you can dicard the PR. @lzybkr thanks for great discussion! |
|
Thanks @iSazonov - I really appreciate your attention to details like this, hopefully we'll see more contributions from you in the future. |
Revert change from PR #1904
•Each parameter set must have at least one unique parameter. If possible, make this parameter a mandatory parameter.
Set both "message" and "title" to optional open a way to "anonymous" request of credential. That is bad. This provokes writing bad code.