Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add a CR to CommandNotFoundException error string#4934

Merged
daxian-dbw merged 1 commit into
masterPowerShell/PowerShell:masterfrom
jpsnover-patch-1PowerShell/PowerShell:jpsnover-patch-1Copy head branch name to clipboard
Sep 29, 2017
Merged

Add a CR to CommandNotFoundException error string#4934
daxian-dbw merged 1 commit into
masterPowerShell/PowerShell:masterfrom
jpsnover-patch-1PowerShell/PowerShell:jpsnover-patch-1Copy head branch name to clipboard

Conversation

@jpsnover

Copy link
Copy Markdown
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!

@SteveL-MSFT SteveL-MSFT left a comment

Copy link
Copy Markdown
Member

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

</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
Copy Markdown
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
Copy Markdown
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

iSazonov commented Oct 2, 2017

Copy link
Copy Markdown
Collaborator

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

iSazonov commented Oct 3, 2017

Copy link
Copy Markdown
Collaborator

@SteveL-MSFT Could you please clarify?

@SteveL-MSFT

Copy link
Copy Markdown
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.