Repository navigation
Fix Move-Item -Path with wildcard char - #7397
Conversation
Unescape non-literal, non-glob path in ProccessRecord and set the context.SuppressWildcardExpansion in RenameItem. This solve the issue where Rename-Item complains -Path does not exist when both -Path and CWD contains special characters.
Ilya (iSazonov)
left a comment
There was a problem hiding this comment.
I wonder that we have so many try-catch blocks. Perhaps we could remove half of them ( in new PR).
|
Michael Klement (@mklement0) Could you please (fast) review last (~10) kwkam 's PRs related to literal paths, wildcards and escapes? Steve Lee (@SteveL-MSFT) Should we speed up the review of the PRs or postpone it after 6.1? |
|
Ilya (@iSazonov) other than a handful of issues marked for 6.1, if other PRs make it in that's great, if they don't we'll start shipping 6.2 Previews after 6.1 RC is out in a few weeks. Since we have stable and preview channels now, it should be ok for people to depend on stable builds and try out preview builds. Right now most of my team is focused on some other things not directly PSCore6.1 related. |
|
Ilya (@iSazonov): Sorry, that's more than I can take on right now; I've glanced at this one, and it looks fine. |
Unescape non-literal, non-glob path in ProccessRecord and set the context.SuppressWildcardExpansion in RenameItem. This solve the issue where Rename-Item complains -Path does not exist when both -Path and CWD contains special characters.
PR Summary
Set the context.SuppressWildcardExpansion in MoveItem instead of
escaping the path every time. Also solve the issue where Move-Item
complains -Path wildcard pattern is not valid when -Path contains
special characters that forms an invalid pattern.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests