-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Description
Note:
Get-Itemappears not to be affected, onlyGet-ChildItem- Problem exists on all supported platforms.
Wildcard patterns support ` as the escape character to represent literal ` instances in the filename and to escape the following metacharacters: * ? [ ]
Steps to reproduce
# Create a file that contains a literal backtick and a literal substring that would be a valid
# sub-pattern if interpreted as a wildcard expression.
New-Item -Type File 'a`[b]'
# Match the newly created file using a wildcard expression with suitable escaping.
# The following 2 command should be equivalent, but currently aren't.
Get-ChildItem * -Include 'a```[b`]'
Get-ChildItem -Path 'a```[b`]'Expected behavior
Both Get-ChildItem commands should match the newly created file and output information about it.
Actual behavior
The 2nd command unexpectedly fails:
Get-ChildItem : Cannot find path '/Users/jdoe/a```[b`]' because it does not exist.
...
Again, note that Get-Item does not exhibit this problem.
Environment data
PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on macOS 10.12.4
PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on Ubuntu 16.04.1 LTS
PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on Microsoft Windows 10 Pro (64-bit; v10.0.14393)Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module