Filter Get-ChildItem by an array


I have just started using PowerShell today, and I have an intention list files by a few patterns in an array, for instance:

I want to list files in a $sourceDir where any of the item in the above array matches.

I can do this, and it works:

Just for learning purposes, can I do it in pipe-lining?

Something similar to this:


You can just do:


Filter Get-ChildItem by an array by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply