Powershell | Where-object Function Problem [duplicate]

I have got a problem with Where-object function in Powershell.

Get-ChildItem "$CurrentPath\TEMP"

Result

When I try to do a search on the name object, this is the result:

Get-ChildItem "$CurrentPath\TEMP" | Where-Object {$_.Name -match "[Erai-raws] B"}

Result

There must be some problem with the "[]" characters, if I do the same search with this I get a result:

Get-ChildItem "$CurrentPath\TEMP" | Where-Object {$_.Name -match "[Erai-raws] "}

Result

Do you have a solution to allow me to perform a search with the Name object knowing that my search variable is: [Erai-raws] Boku no Hero Academia 4th Season - 01 [720p] [Multiple Subtitle]

I have already tried with like, with match but as soon as I put "[] *", nothing more "match" ...

Thank you

评论