24 votesa supported this idea ·
An error occurred while saving the commenta commented
The same way that an asterisk in a single quoted string is still a filesystem wildcard, e.g. `ls '*.txt' Brackets are wildcards, they represent groups of characters, [abc.txt] would match a.txt or b.txt or c.txt. Avoiding this is what the -LiteralPath parameter is for, use it instead of -Path e.g. ls -literalpath '[abc].txt'.