I want to list all files ending with some text in square brackets.
But neither Get-ChildItem *[*
nor Get-ChildItem *`[*
nor Get-Child
You have to use the -Filter
Parameter correct.
When you don't specify the Parameter, like you did in your examples, it will assume you want to use the first Parameter (in this case -Path
, Ref. Get-ChildItem Doc).
Try this instead:
Get-ChildItem -Filter "*`[*"
This found the file ad.a[s]
for me.
You can also change the filter to this:
Get-ChildItem -Filter "*`[*`]"
to expand it for the closing bracket.