How do I get get-childitem to filter on multiple file types?
dir .\* -include ('*.xsl', '*.xslt') -recurse
I do not know why, but this one seems to be much faster:
dir .\ -recurse | where {$_.extension -in ".xsl",".xslt"}
The "filters" *.xsl
and *.xslt
can be part of the path parameter as well. Path can take a string array:
Set-Location c:\topLevel
gci *.xsl, *.xslt -Recurse