I am trying to use the GCI command to call all the files within a folder bar the ones with "december" in their name.
I would also like to not call files from a subfolder called "months".
I am trying to use the GCI command to call all the files within a folder bar the ones with "december" in their name.
I would also like to not call files from a subfolder called "months".
Try this:
Get-ChildItem c:\somefolder -exclude months,*december*
The Exclude
parameter accepts an array of terms to exclude. These terms can include wildcard characters.