Skip to content

Conversation

@kvprasoon
Copy link
Contributor

Added more helpful message for AmbiguousParameterSet exception which always throws exception "Parameter set cannot be resolved using the specified named parameters" which is not properly conveying the end user for further steps required.

kvprasoon and others added 5 commits October 15, 2017 13:17
…ion the depth of the split operation."

This reverts commit 8215869.
Added more helpful message for AmbiguousParameterSet exception which always throws exception "Parameter set cannot be resolved using the specified named parameters" which is not properly conveying the end user for further steps required.
Copy link
Contributor

@markekraus markekraus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! Please make modifications to your pull request.

</data>
<data name="AmbiguousParameterSet" xml:space="preserve">
<value>Parameter set cannot be resolved using the specified named parameters.</value>
<value>Parameter set cannot be resolved using the specified named parameters.One or few of the parameters mentioned cannot be used together.Do a Get-command {0} to see the available parameter sets.</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add spaces between periods and the first word of a sentence
  • One or few should be One or more but, this could also occur when an insufficient number of parameters have been supplied, not just when 2 parameters cannot be used together.
  • parameters mentioned should be parameters issued.
  • Do a Get-command {0} do all instances of this error pass the current command name to this string for formatting? if not, this could be very confusing.
  • Get-Help would be preferable to Get-Command as Get-Command does not show this information be default.
  • parameter sets is some what esoteric to function./cmdlet authors. To an admin user it might be better to say For syntax help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi , Thanks for the review, I'll do the required modifications


Previoues review comments
• Add spaces between periods and the first word of a sentence - Done
• One or few  should be  One or more  but, this could also occur when an insufficient number of parameters have been supplied, not just when 2 parameters cannot be used together. - Done
• parameters mentioned  should be  parameters issued . - Done
• Do a Get-command {0}  do all instances of this error pass the current command name to this string for formatting? if not, this could be very confusing. - Done, changed to a generic message without deending on the first element
• Get-Help  would be preferable to  Get-Command  as  Get-Command  does not show this information be default. - Done, changed to Get-Help
• parameter sets  is some what esoteric to function./cmdlet authors. To an admin user it might be better to say  For syntax help . - Done
@kvprasoon
Copy link
Contributor Author

I have updated it as per the comments

Added cmdlets along with script/function in the error message .
Copy link
Contributor Author

@kvprasoon kvprasoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review,I have updated it as per the comments

• Add spaces between periods and the first word of a sentence - Done
• One or few should be One or more but, this could also occur when an insufficient number of parameters have been supplied, not just when 2 parameters cannot be used together. - Done
• parameters mentioned should be parameters issued . - Done
• Do a Get-command {0} do all instances of this error pass the current command name to this string for formatting? if not, this could be very confusing. - Done, changed to a generic message without deending on the first element
• Get-Help would be preferable to Get-Command as Get-Command does not show this information be default. - Done, changed to Get-Help
• parameter sets is some what esoteric to function./cmdlet authors. To an admin user it might be better to say For syntax help . - Done

Copy link
Contributor Author

@kvprasoon kvprasoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review,I have updated it as per the comments

• Add spaces between periods and the first word of a sentence - Done
• One or few should be One or more but, this could also occur when an insufficient number of parameters have been supplied, not just when 2 parameters cannot be used together. - Done
• parameters mentioned should be parameters issued . - Done
• Do a Get-command {0} do all instances of this error pass the current command name to this string for formatting? if not, this could be very confusing. - Done, changed to a generic message without deending on the first element
• Get-Help would be preferable to Get-Command as Get-Command does not show this information be default. - Done, changed to Get-Help
• parameter sets is some what esoteric to function./cmdlet authors. To an admin user it might be better to say For syntax help . - Done

</data>
<data name="AmbiguousParameterSet" xml:space="preserve">
<value>Parameter set cannot be resolved using the specified named parameters.</value>
<value>Parameter set cannot be resolved using the specified named parameters. One or more of the parameters issued cannot be used together. Do a Get-Help on your script/function/cmdlet for the syntax help.</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • One or more of the parameters issued cannot be used together. This still doesn't address the case where too few parameters are supplied. For example: foo has 2 parameter sets -A -B -C and -A -B -D but the user only supplied -A -B. It's not that -A and -B can't be used together, but that -C or -D are needed to determine the parameter set.
  • Do a Get-Help on your script/function/cmdlet for the syntax help. I think this is would be somewhat confusing. I'm not sure how to fix it. The wording could at least be improved Use Get-Help with your script, function, or cmdlet for syntax help.

One or more of the parameters issued cannot be used together.  This still doesn't address the case where too few parameters are supplied. For example:  foo  has 2 parameter sets  -A -B -C  and  -A -B -D  but the user only supplied  -A -B . It's not that  -A  and  -B  can't be used together, but that  -C  or  -D  are needed to determine the parameter set. - Added the information about not using the decision making parameter
• Do a Get-Help on your script/function/cmdlet for the syntax help.  I think this is would be somewhat confusing. I'm not sure how to fix it. The wording could at least be improved  Use Get-Help with your script, function, or cmdlet for syntax help.  - changed to suggested message
Copy link
Contributor Author

@kvprasoon kvprasoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One or more of the parameters issued cannot be used together. This still doesn't address the case where too few parameters are supplied. For example: foo has 2 parameter sets -A -B -C and -A -B -D but the user only supplied -A -B . It's not that -A and -B can't be used together, but that -C or -D are needed to determine the parameter set. - Added the information about not using the decision making parameter
• Do a Get-Help on your script/function/cmdlet for the syntax help. I think this is would be somewhat confusing. I'm not sure how to fix it. The wording could at least be improved Use Get-Help with your script, function, or cmdlet for syntax help. - changed to suggested message

Copy link
Contributor Author

@kvprasoon kvprasoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review

@kvprasoon kvprasoon closed this Nov 19, 2017
@kvprasoon kvprasoon reopened this Nov 19, 2017
Copy link
Contributor Author

@kvprasoon kvprasoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can anyone help me by reviewing this

@iSazonov
Copy link
Collaborator

@kvprasoon I guess PowerShell team is fully obsessed with the release of the new version.
Also please rebase to get latest updates - I think this help to pass CIs.

/cc @SteveL-MSFT Should we use direct tips in error messages or use HelpSystem capabilites?

</data>
<data name="AmbiguousParameterSet" xml:space="preserve">
<value>Parameter set cannot be resolved using the specified named parameters.</value>
<value>Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or a parameter which will decide the parameter set is not provided. Use Get-Help with your script, function, or cmdlet for syntax help.</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or a parameter which will decide the parameter set is not provided.

Perhaps this should be or an insufficient number of parameters were provided. There could certainly be more than one missing.

@SteveL-MSFT
Copy link
Member

@iSazonov since you added Type 'help' for help as part of the startup banner, it seems unnecessary to point users to get-help in any error message. PowerShell does have a suggestion system that we should try to take advantage of in the future to provide more concise help on how to resolve issues (like if they type a parameter name wrong, we can do some matching and suggest what they meant which is different from this PR).

For this particular issue, I think the ideal error message would tell the user which parameters are mutually exclusive and can't be used together or if another parameter is required to resolve the parameter set. I added a note to #5175 which covers a new proposal on defining mutually exclusive parameters to have better error messages.

For this PR, I think it would be sufficient to update the error message to what @markekraus is proposing without the get-help mention on the end which is to generic.

@iSazonov
Copy link
Collaborator

@SteveL-MSFT Thanks for clarify and confirm my thoughts.

@markekraus
Copy link
Contributor

markekraus commented Nov 20, 2017

#5505 has been opened instead.

@markekraus markekraus closed this Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants