Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use Filter Parameter with Get-ChildItem in PowerShell

$
0
0

Summary: Use the –Filter parameter with the Get-ChildItem Windows PowerShell cmdlet.

Hey, Scripting Guy! Question Why can't I get the –Filter parameter to work with the Get-ChildItem cmdlet?

Hey, Scripting Guy! Answer Try using the FileSystem provider. The –Filter parameter will accept two wildcard characters ( ? and )
           and a single string as a filter (not an array of strings like the –Include parameter uses). Here is an example
           of using –Filter to look for document files:

Get-ChildItem E:\Data -filter "*doc*"


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>