Skip to content

PathUtils: handle escaped -Path correctly - #7405

Closed
kwkam wants to merge 2 commits into
PowerShell:masterfrom
kwkam:wc-pathutils
Closed

kwkam wants to merge 2 commits into
PowerShell:masterfrom
kwkam:wc-pathutils

Conversation

@kwkam

@kwkam kwkam commented Jul 30, 2018 •

Copy link
Copy Markdown
Contributor

PR Summary

Unescape non-literal, non-glob path before calling
GetUnresolvedProviderPathFromPSPath since it only accepts literal path.
This solve the issue where some commands depending on that method
will treat -Path as literal unintentionally. For example,

Out-File -Path './`[out`].txt' -Append

will create a new file named "`[out`].txt" instead of writing to "[out].txt".

PR Checklist

Unescape non-literal, non-glob path before calling
GetUnresolvedProviderPathFromPSPath since it only accepts literal path.
This solve the issue where some commands depending on that method
will treat -Path as literal unintentionally. For example,
> Out-File -Path './`[out`].txt' -Append
will create a new file named "`[out`].txt" instead of writing to "[out].txt".
@kwkam kwkam mentioned this pull request Jul 30, 2018
6 of 11 tasks
@kwkam kwkam changed the title [Feature] PathUtils: handle literal -Path correctly PathUtils: handle literal -Path correctly Jul 31, 2018
@stale

stale Bot commented Aug 30, 2018

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days.
Thank you for your contributions.
Community members are welcome to grab these works.

@stale stale Bot added the Stale label Aug 30, 2018
@stale stale Bot removed the Stale label Sep 9, 2018
@kwkam kwkam changed the title PathUtils: handle literal -Path correctly PathUtils: handle escaped -Path correctly Sep 9, 2018
@stale

stale Bot commented Oct 9, 2018

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days.
Thank you for your contributions.
Community members are welcome to grab these works.

@stale stale Bot added the Stale label Oct 9, 2018
@stale

stale Bot commented Oct 19, 2018

Copy link
Copy Markdown

This PR has be automatically close because it is stale. If you wish to continue working on the PR, please first update the PR, then reopen it.
Thanks again for your contribution.
Community members are welcome to grab these works.

@stale stale Bot closed this Oct 19, 2018
@kwkam

kwkam commented Nov 10, 2018

Copy link
Copy Markdown
Contributor Author

This also cannot be reopened. Do I have to create a new PR?

@kwkam kwkam mentioned this pull request Mar 31, 2019
7 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant