Change error message when using New-Item to create a symlink and the item exists#3703
Change error message when using New-Item to create a symlink and the item exists#3703daxian-dbw merged 3 commits intoPowerShell:masterfrom jeffbi:bad-error-3700
Conversation
…item exists (#3700) Also changed the ErrorId to "SymLinkExists".
| $link.LinkType | Should BeExactly "SymbolicLink" | ||
| $link.Target | Should Be $nonFile | ||
| } | ||
| It "New-Item fails informatively when reversing Path and Target" { |
There was a problem hiding this comment.
Please make the title more clear.
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> |
There was a problem hiding this comment.
Maybe use the pattern from tests - "Path {0} to symbolic link already exists." ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
In this context we should mention "symbolic link".
Maybe "Cannot create symbolic link because the path {0} already exists."
There was a problem hiding this comment.
I like that one. Fixed.
I also changed the name of the new string, to be a bit more clear about its use.
|
LGTM. |

Fix #3700
Improves the error displayed when attempting to create a
SymbolicLinkand the item named in-Pathalready exists.Also changed the ErrorId to "SymLinkExists" to better identify the error.