Posted On: Feb 22, 2018
A lot of commands in the PowerShell return values that are not always useful. To get useful return objects from the commands we can use filters. Filters can be created using the Filter parameter or even using the Where-Object. We can use the Filter parameter with the Get-ChildItem to get the items that we specified in the filter.
//example PS> Get-ChildItem -Path C:\folder\ -Filter '*1*.txt'
The above command filters and returns the files with a prefix as ‘1’. The same result can be achieved using the Where-Object, but generally, the filter is much faster than the Where-Object.
Never Miss an Articles from us.