-
Notifications
You must be signed in to change notification settings - Fork 8.1k
PathUtils: handle escaped -Path correctly #9258
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
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".
|
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. |
SteveL-MSFT
left a comment
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.
LGTM
|
I think we need to think about the current behavior again.
This does seem to be confusing -- |
|
FYI, |
|
Reference my comment on the related issue: #9475 (comment) |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Need to rethink about the current behavior.
|
As is stated in my comments, the wildcard pattern issue is a general issue that should be well thought and fixed in a wider scope. So I will close this PR. |
Reopen #7405
PR Summary
Unescape non-literal, non-glob path before calling
GetUnresolvedProviderPathFromPSPath since it only accepts literal path.
PR Context
This solve the issue where some commands depending on that method
will treat -Path as literal unintentionally. For example,
will create a new file named
"`[out`].txt"instead of writing to"[out].txt".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.