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-Location
Expected 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
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)
Expected behavior
The test should succeed.
Actual behavior
The test fails, because the pattern is not expanded (
'a *'is echoed).Environment data