Fix error message from new symbolic link missing target by yecril71pl · Pull Request #13085 · PowerShell/PowerShell
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
Conversation
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
PR Summary
Fixes #13073 (well, at least descreases its morbidity).
PR Context
When the target value was not given and New-Item throws an exception, use the custom message format intended to be used.
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Make sure all
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header - This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix
- Breaking changes
- None
- OR
- Experimental feature(s) needed
- Experimental feature name(s):
- User-facing changes
- Not Applicable
- OR
- Documentation needed
- Issue filed:
- Testing - New and feature
- N/A or can only be tested interactively
- OR
- Make sure you've added a new test if existing tests do not effectively test the code changed
- Tooling
- I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
- OR
- I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
- Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host).
- Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
- Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
- Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
iSazonov
added
the
CL-General
label
Jul 2, 2020I was told we cannot test the exception message because of localisation and that we should test the missing parameter instead. I disagree because CI tests run under C locale anyway, byt here you are.
This message is currently used when we fail to create a link, so we decided to be more specific. I also changed the name to reflect this assumption.
@yecril71pl Thanks for discovering and fixing the issue!
@yecril71pl Thanks for discovering and fixing the issue!
My pleasure. I would like to note that:
- I am still unhappy that
-TARGETis not formally mandatory in this case. - I contend that
-PARAMETER:VALUEis a better syntax in most cases because it is explicit and unambiguous.
I am still unhappy that -TARGET is not formally mandatory in this case.
The cmdlet is provider based. I think it is impossible to make it mandatory for all scenarios. So the fix is good.
I contend that -PARAMETER:VALUE is a better syntax in most cases because it is explicit and unambiguous
We follow common pattern for tests. It would be huge work to change a style for all tests.
🎉v7.1.0-preview.6 has been released which incorporates this pull request.:tada:
Handy links:
ghost
mentioned this pull request