I’m not sure I fully understand the question. However, there’s a neat trick with PowerShell and Get-ChildItem that allows you to search at a specific depth using wildcards:
Get-ChildItem -Path 'RootFolder\*\*\*'
This will return all items that are nested two levels deep beneath RootFolder, for example, “RootFolder\SubFolder1\SubFolder2\file.txt”, etc. This is much shorter than writing a recursive function yourself.
Sorry then if I was not clear. All the files I need to search for are 1 level deeper than C:\NG_auto_project\nextgene_to_import.
I guess I only need to put C:\NG_auto_project\nextgene_to_import**\ .