-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
See also (the inverse problem): #18038
When calling external programs (native programs) on Unix-like platforms, wildcard patterns that you want automatic globbing applied to (as in Bash, for instance) must be unquoted, i.e. they must neither be enclosed in single quotes nor in double quotes.
Therefore, if you want globbing to be applied to a wildcard pattern that has spaces, for instance, you need to individually escape the space, namely as `
However, the automatic globbing mechanism currently doesn't recognize that and doesn't expand such patterns.
Steps to reproduce
On Linux (native globbing is currently fundamentally broken on macOS, and isn't applied on Windows)
Push-Location temp:/
touch 'a b.txt'
/bin/echo a` * | Should -Be 'a b.txt'
Remove-Item 'a b.txt'
Pop-LocationExpected behavior
The test should succeed.
Actual behavior
The test fails, because the pattern is not expanded ('a *' is echoed).
Environment data
PowerShell Core v7.0.0-preview.3
Metadata
Metadata
Assignees
Labels
Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime