PowerShell
PowerShell copied to clipboard
Add in Url Alias for IRM/IWR Cmdlets
PR Summary
Fixes #16658
PR Context
Users may get URI/URL mixed up and by adding an alias to this shared parameter will reduce errors in interactive scripting
PR Checklist
- [x] PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- [x] Summarized changes
- [x] Make sure all
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright header - [x] 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 (theWIP
bot will keep its status check atPending
while 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
- [x] None
- OR
- [ ] Experimental feature(s) needed
- [ ] Experimental feature name(s):
-
User-facing changes
- [ ] Not Applicable
- OR
- [x] Documentation needed
- [ ] Issue filed:
-
Testing - New and feature
- [ ] N/A or can only be tested interactively
- OR
- [x] Make sure you've added a new test if existing tests do not effectively test the code changed
-
Tooling
- [x] 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 opened an issue in the relevant tool repository. This may include:
- [ ] Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode
(which runs in a different PS Host).
- [ ] Issue filed:
- [ ] Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
- [ ] Issue filed:
- [ ] Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
- [ ] Issue filed:
- [ ] Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
- [ ] Issue filed:
- [ ] Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode
(which runs in a different PS Host).
Make draft until we get a conclusion from WG in related issue.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.
@PaulHigin can you please review this along with the conversation in #16658 & comment on whether or not this is something that could be merged or not
This seems like a reasonable change to me, and I don't see how this would be a breaking change. However, the cmdlet working group should weigh in on it. So adding that tag.
For WG. I can't agree with that cosmetic addition.
- URI is not wrong term in the context
- Aliases are always bad thing until they do useful work. Ex., we added PSPath alias to LiteralPath parameter of many cmdlets. As result we get perf win because of skipping unneeded globbing.
- For interactive scenario - the source of this request - we have tab-completion, suggestions and now predictions - all this makes cosmetic aliases unnecessary.
For interactive scenario - the source of this request - we have tab-completion, suggestions and now predictions - all this makes cosmetic aliases unnecessary.
Sorry @iSazonov I have to disagree with you on especialy on that last part because you are forgetting about the non-advanced users who are coming to this language for the first time, who may not know about tab-completion, suggestions and now predictions
as well as those using the language for years and still don't use those to their full potential. Plus this request was as pointed out in the issue based on a long standing Microsoft FTE who correctly pointed out that muscle memory in this particular instance causes unneccessary failures, which this PR would address and is exactly why we have aliases on parameters, for improving the user experience not for engine perfomance gains like you mention in your 2nd point & your first isn't an issue of being technically correct, but an issue that many users do not understand the differnce between them and use them interchangably.
This is defiinitley more for the Interactive UX WG than the Cmdlets one I think @PaulHigin so I'm tagging @JamesWTruher & @daxian-dbw as these are their key areas from that WG
@kilasuit I could agree if we made a breaking change and replaced the parameter name, but otherwise it only worsens the UX - aliases have never been a public contract and are not mentioned anywhere - neither in documentation, nor in tab completion. And there are all kinds of newbies - those who learn and those who are lazy. You don't have to worry about the latter, and the former, if they were able to find this teamlet, no doubt they are already familiar with the list of parameters.
@iSazonov - sorry, whilst I respect your POV on just about everything else when it comes to PowerShell i have to point out that your view here is currently not correct
- They are a part of the public contract
- They are documented (albeit poorly) in this doc but called out fully in this section of this other doc
- Implict parameter completion allows use of named aliases or lazy aliases
- As @PaulHigin mentioned this isn't a breaking change and is why aliases exist to not end up being a breaking change in the first place
Labelled both this PR and the issue with WG-Interactive-Console
, as the main disagreement in the discussions in #16658 is about a subtle change in tab completion for this parameter when the Emacs
edit mode is in use, see https://github.com/PowerShell/PowerShell/issues/16658#issuecomment-1001809209.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.
This is currently waiting agreement based on the above mentioned comment in the issue as this has identified a potential additional change to PSReadline (raised in https://github.com/PowerShell/PSReadLine/issues/3198) to equate for adapting this particular user experience.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.
This PR has 19
quantified lines of changes. In general, a change size of upto 200
lines is ideal for the best PR experience!
Quantification details
Label : Extra Small
Size : +19 -0
Percentile : 7.6%
Total files changed: 2
Change summary by file extension:
.cs : +1 -0
.ps1 : +18 -0
Change counts above are quantified counts, based on the PullRequestQuantifier customizations.
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a balance between between PR complexity and PR review overhead. PRs within the optimal size (typical small, or medium sized PRs) mean:
- Fast and predictable releases to production:
- Optimal size changes are more likely to be reviewed faster with fewer iterations.
- Similarity in low PR complexity drives similar review times.
- Review quality is likely higher as complexity is lower:
- Bugs are more likely to be detected.
- Code inconsistencies are more likely to be detected.
- Knowledge sharing is improved within the participants:
- Small portions can be assimilated better.
- Better engineering practices are exercised:
- Solving big problems by dividing them in well contained, smaller problems.
- Exercising separation of concerns within the code changes.
What can I do to optimize my changes
- Use the PullRequestQuantifier to quantify your PR accurately
- Create a context profile for your repo using the context generator
- Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the
Excluded
section from yourprquantifier.yaml
context profile. - Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your
prquantifier.yaml
context profile. - Only use the labels that matter to you, see context specification to customize your
prquantifier.yaml
context profile.
- Change your engineering behaviors
- For PRs that fall outside of the desired spectrum, review the details and check if:
- Your PR could be split in smaller, self-contained PRs instead
- Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).
- For PRs that fall outside of the desired spectrum, review the details and check if:
How to interpret the change counts in git diff output
- One line was added:
+1 -0
- One line was deleted:
+0 -1
- One line was modified:
+1 -1
(git diff doesn't know about modified, it will interpret that line like one addition plus one deletion) - Change percentiles: Change characteristics (addition, deletion, modification) of this PR in relation to all other PRs within the repository.
Was this comment helpful? :thumbsup: :ok_hand: :thumbsdown: (Email) Customize PullRequestQuantifier for this repository.
Reopening this PR & asking for others in the Interactive UX WG to comment on this.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.