Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Effective way to filter on multiple wildcards in PowerShell

Tags:

powershell

I'd like to be able to do

gci -filter *.ps1,*.cs,*.sql

but that syntax isn't supported.

like image 854
Scott Weinstein Avatar asked Feb 26 '23 17:02

Scott Weinstein


1 Answers

Use -Include which takes an array, instead of -Filter. Note that you have to use * as the path when using -Include:

Get-ChildItem * -Include *.ps1,*.cs,*.sql
like image 137
Julien Lebosquain Avatar answered May 10 '23 10:05

Julien Lebosquain