gci and -include and -exclude

D

Dan Holmes

I am trying get a limited set of files from a directory tree. The following is what i want but it doesn't work. I get
everything.


get-childitem -LiteralPath \rm5_0_code_h\source -include *.frm,*.ctl,*.bas,*.cls,*.cs,*.cpp,*.hpp,*.sql,*.java -Recurse


I have even tried to exclude what i don't want but it doesn't seem to matter.

get-childitem -LiteralPath $path -include *.frm,*.ctl,*.bas,*.cls,*.cs,*.cpp,*.hpp,*.sql,*.java -recurse -exclude
*alter*.sql,*.dll,*.pdb,*.ncb,*.tlb,*.scc,*.bmp,*.ico

i still get them all. what am i doing wrong?

dan
 

My Computer

M

Michael Soza

you have to ask for all files and then filter with the include. Example:
ls * -include *.exe #ask for all files in the actual dir and then apply
the filter.

You miss the first *


"Dan Holmes" <[email protected]> wrote in message
news:#[email protected]

> I am trying get a limited set of files from a directory tree. The
> following is what i want but it doesn't work. I get everything.
>
>
> get-childitem -LiteralPath \rm5_0_code_h\source -include
> *.frm,*.ctl,*.bas,*.cls,*.cs,*.cpp,*.hpp,*.sql,*.java -Recurse
>
>
> I have even tried to exclude what i don't want but it doesn't seem to
> matter.
>
> get-childitem -LiteralPath $path -include
> *.frm,*.ctl,*.bas,*.cls,*.cs,*.cpp,*.hpp,*.sql,*.java -recurse -exclude
> *alter*.sql,*.dll,*.pdb,*.ncb,*.tlb,*.scc,*.bmp,*.ico
>
> i still get them all. what am i doing wrong?
>
> dan
 

My Computer

Top