-
Notifications
You must be signed in to change notification settings - Fork 8k
Make -OutFile param in web cmdlets to work like -LiteralPath
#11701
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
Make -OutFile param in web cmdlets to work like -LiteralPath
#11701
Conversation
6d80ba9 to
75de300
Compare
|
I don't particularly like that the parameter name doesn't indicate the direction - |
The change was approved as a compromise because we have RFC for web file operations cmdlet. /cc @mklement0 |
|
Irrespective of the parameter "future-proofing" argument, if I'm looking at code and I see |
|
I agree that retaining the Taking a step back:
The reason for the decision in #3174 was a backward-compatibility concern: conceivably, someone could have used Is this a real-world concern? It strikes me as a clear-cut bucket 3 case. Thumbing through GitHub code, I don't see instances of wildcard use, at least at first glance:
Given that the workaround for the inability to use Therefore, we could:
|
|
/cc @SteveL-MSFT For PowerShell Committee - in #3174 a conclusion was #3174 (comment) rename OutFile to Path and add LiteralPath. Current @mklement0's request is review this again to leave OutFile parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the other cmdlets which provide LiteralPath also have a PSPath alias. Should that be done here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the PSPath is mainly used for pipeline parameter binding. Because the parameter doesn't get arguments from pipeline I removed the alias.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add some commentary why you didn't use parameter sets here? If we ever change our parameter set logic, this could be one of those places where we could take advantage of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have already 3 parameter sets and class inheritance. I'm afraid adding two more parameter sets highly complicates the code and may turn into a headache. I'd prefer to postpone this to another PR if we really want this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be clear, I wasn't suggesting additional parameter sets. Your reasoning is sound, it's pretty complicated, and doesn't need to be more so. I was just looking for commentary in the code as to why so others doing reviews or later maintenance would understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change was reverted as PowerShell Committee request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
| Context "Path and LigeralPath parameters work" { | |
| Context "Path and LiteralPath parameters work" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It "Cannot use both Path and LigeralPath parameters" { | |
| It "Cannot use both Path and LiteralPath parameters" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It "Path and LigeralPath parameters work in Invoke-WebRequest" { | |
| It "Path and LiteralPath parameters work in Invoke-WebRequest" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It "Path and LigeralPath parameters work in Invoke-RestMethod" { | |
| It "Path and LiteralPath parameters work in Invoke-RestMethod" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
@iSazonov is this still WIP? if not, please change the title. |
|
@PowerShell/powershell-committee reviewed this again. @iSazonov apologies on changing our decision on you, but we agree with the current proposal to have |
af87a08 to
0891da7
Compare
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
0891da7 to
bb45d55
Compare
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
|
@SteveL-MSFT @TravisEz13 The PR is ready to review. |
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
This reverts commit 36465ad61ff2a772a2d1185096ff779b4b637042.
…dlets" This reverts commit 1e03c5f61e83a8de8f96766965010b9178c627cb.
bb45d55 to
e0e2d5a
Compare
|
@TravisEz13 @SteveL-MSFT Please review the PR. |
-OutFile param in web cmdlets to work like -LiteralPath
|
🎉 Handy links: |
PR Summary
Now OutFile parameter in Invoke-WebRequest and Invoke-RestMethod works like LiteralPath and does not process wildcards.
PR Context
Fix #3174 - approved by PowerShell Committee.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP: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.