Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CR to CommandNotFoundException error string #4934

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

jpsnover
Copy link
Contributor

We're here at PowerShell Unplugged at Ignite, and this error message could really use a carriage return!

We're here at PowerShell Unplugged at Ignite, and this error message could *really* use a carriage return!
Copy link
Member

@SteveL-MSFT SteveL-MSFT 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 contribution, but string resources should not contain newlines as it may produce unexpected results when it goes through FormatAndOutput

@@ -136,7 +136,8 @@
<value>Cannot retrieve an instance of CommandDiscovery.</value>
</data>
<data name="CommandNotFoundException" xml:space="preserve">
<value>The term '{0}' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.</value>
<value>The term '{0}' is not recognized as the name of a cmdlet, function, script file, or operable program.
Copy link
Member

Choose a reason for hiding this comment

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

Formatting should be handled by FormatAndOutput. String messages should not contain newlines.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps adding new newlines is something we should consider for other strings as it can improve readability.

@daxian-dbw daxian-dbw merged commit b9845d5 into master Sep 29, 2017
@daxian-dbw daxian-dbw deleted the jpsnover-patch-1 branch September 29, 2017 19:16
@iSazonov
Copy link
Collaborator

iSazonov commented Oct 2, 2017

Please clarify what was idea here.
Before the change:

> qwerty
qwerty : The term 'qwerty' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ qwerty
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (qwerty:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

After the change:

PS C:\Users\sie\Documents\GitHub\iSazonov\PowerShell> qwerty
qwerty : The term 'qwerty' is not recognized as the name of a cmdlet, function, script file, or operable program.
      Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ qwerty
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (qwerty:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Or idea was to change command line error formatting?
From:

> .\debug\powershell.exe -sma
The argument '-sma' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

To:

> .\debug\powershell.exe -sma
The argument '-sma' is not recognized as the name of a script file. 
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

@iSazonov
Copy link
Collaborator

iSazonov commented Oct 3, 2017

@SteveL-MSFT Could you please clarify?

@SteveL-MSFT
Copy link
Member

@iSazonov I believe the intent was to have the next sentence on the next line left justified. The whitespace should have been removed. I'll submit PR.

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.

None yet

4 participants