FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Change error message when using New-Item to create a symlink and the item exists by jeffbi · Pull Request #3703 · PowerShell/PowerShell · GitHub

Change error message when using New-Item to create a symlink and the item exists - #3703

Merged
Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
jeffbi:bad-error-3700
May 5, 2017
Merged

Change error message when using New-Item to create a symlink and the item exists#3703
Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
jeffbi:bad-error-3700

Conversation

jeffbi commented May 5, 2017
edited by daxian-dbw
Loading

Copy link
Copy Markdown

Fix #3700
Improves the error displayed when attempting to create a SymbolicLink and the item named in -Path already exists.

Also changed the ErrorId to "SymLinkExists" to better identify the error.

…item exists (#3700)

Also changed the ErrorId to "SymLinkExists".
<data name="ItemExists" xml:space="preserve">
<value>Item '{0}' already exists.</value>
</data>
</root> No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please add Newline.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fixed

$link.LinkType | Should BeExactly "SymbolicLink"
$link.Target | Should Be $nonFile
}
It "New-Item fails informatively when reversing Path and Target" {

Ilya (iSazonov) May 5, 2017
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please make the title more clear.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fixed

Added newline to end of resource file.
</data>
</root> No newline at end of file
<data name="ItemExists" xml:space="preserve">
<value>Item '{0}' already exists.</value>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe use the pattern from tests - "Path {0} to symbolic link already exists." ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How about "The path {0} already exists."? That's similar to the error message when New-Item attempts to create a file that already exists, substituting "path" for "file".

I think that "Path {0} to symbolic link..." suggests that the existing item is itself a symbolic link, which is not necessarily the case.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

In this context we should mention "symbolic link".
Maybe "Cannot create symbolic link because the path {0} already exists."

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I like that one. Fixed.

I also changed the name of the new string, to be a bit more clear about its use.

Copy link
Copy Markdown
Collaborator

LGTM.

Dongbo Wang (daxian-dbw) changed the title Change error message when using New-Item to create a symlink and the item exists (#3700) Change error message when using New-Item to create a symlink and the item exists May 5, 2017
Dongbo Wang (daxian-dbw) merged commit 938e136 into PowerShell:master May 5, 2017

jeffbi commented May 5, 2017

Copy link
Copy Markdown
Author

Ilya (@iSazonov) Thanks for the review!

jeffbi deleted the bad-error-3700 branch May 8, 2017 04:55
jeffbi restored the bad-error-3700 branch May 8, 2017 05:01
jeffbi deleted the bad-error-3700 branch May 8, 2017 05:02
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL