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.