Skip to content

Instantly share code, notes, and snippets.

@stack72
Created November 2, 2011 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stack72/1335132 to your computer and use it in GitHub Desktop.
Save stack72/1335132 to your computer and use it in GitHub Desktop.
$test_assemblies = (Get-ChildItem "$src_folder" -Recurse -Include *Test.dll, *Tests.dll)
this will select everything as expected but I want to exclude some folder types
*\obj
*\package
*\debug
Please Help!
@HowardvanRooijen
Copy link

Get-Item -Path C:\MyPath -Exclude obj, package, debug -Include *Test.dll, *Tests.dll | Get-ChildItem -Recurse | Where-Object { -not $_.PSIsContainer }

@alastairs
Copy link

Try this:

$test_assemblies = (Get-ChildItem "$src_folder" -Recurse -Include *Test.dll,*Tests.dll |? { $_.FullName.Contains("\bin\") })

This will filter out anything that doesn't contain the string "\bin" in its path...

@stack72
Copy link
Author

stack72 commented Nov 2, 2011

@alastair that certainly fixed it

@howard thanks for that script - that was useful in another I was having issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment