This works too:
get-childitem $path -recurse -exclude *.cs,*.tt,*.xaml,*.csproj,
*.sln,*.xml,*.cmd,*.txt
Note that -include only works with -recurse or a wildcard in the path. (actually it works all the time in 6.1 pre 2)
Also note that using both -exclude and -filter will not list anything, without -recurse or a wildcard in the path.
-include and -literalpath also seem problematic in PS 5.
There’s also a bug with -include and -exclude with the path at the root “”, that displays nothing. In unix it gives an error.
Excluding a directory like “foo3” (not the full path) is challenging. It doesn’t seem to work with -recurse or -filter. You can pipe to a 2nd get-childitem.
get-childitem -exclude foo3 | get-childitem -recurse -filter file*