-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Remove-Item and Move-Item don't support escape characters in wildcard patterns on Unix #3725
Copy link
Copy link
Closed
Labels
Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productOS-LinuxOS-macOSResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Metadata
Metadata
Assignees
Labels
Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productOS-LinuxOS-macOSResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Note:
Wildcard patterns- at least in the context of
Get-Item- support`as the escape character to represent literal`instances in a path and to escape the following metacharacters:* ? [ ]Remove-ItemandMove-Itemcurrently do not support that, neither with-Pathnor with-Include.Steps to reproduce
Expected behavior
Both commands in each pair should find the target file and output information about how it would be deleted / moved.
Actual behavior
All commands unexpectedly fail to find the file:
Curiously, the error message quotes the correct literal path that it claims doesn't exist.
Move-Item's symptoms differ:Curiously, all existing files in the directory (even those that don't match the pattern) are reported as non-existent.
Environment data