Do we need to loop and recurse here? I think we'll only ever have one file to read, so why not:

 - if we have a config, find it's `repositoryPath` value. 
 - does it exist? use it.
 - otherwise return `Join-Path $solutionDir "packages"`