Skip to content

Fix Move-Item -Path with wildcard char - #7397

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
kwkam:wc-moveitem
Aug 5, 2018
Merged

Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
kwkam:wc-moveitem

Conversation

@kwkam

@kwkam kwkam commented Jul 29, 2018 •

Copy link
Copy Markdown
Contributor

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

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.

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder that we have so many try-catch blocks. Perhaps we could remove half of them ( in new PR).

@iSazonov

Copy link
Copy Markdown
Collaborator

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?

@SteveL-MSFT

Copy link
Copy Markdown
Member

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.

@kwkam kwkam changed the title [Feature] Fix Move-Item -Path with wildcard char Fix Move-Item -Path with wildcard char Jul 31, 2018
@mklement0

Copy link
Copy Markdown
Contributor

Ilya (@iSazonov): Sorry, that's more than I can take on right now; I've glanced at this one, and it looks fine.

@iSazonov
Ilya (iSazonov) merged commit fbfbb4f into PowerShell:master Aug 5, 2018
@kwkam
kwkam deleted the wc-moveitem branch January 11, 2019 15:04
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants