PathUtils: handle escaped -Path correctly#9258
PathUtils: handle escaped -Path correctly#9258kwkam wants to merge 2 commits intoPowerShell:masterfrom
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. |
|
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.