I would like to find all directories at the top level from the location of the script that are stored in subversion.
In C# it would be something like this
Directory.GetDirectories(".")
.Where(d=>Directories.GetDirectories(d)
.Any(x => x == "_svn" || ".svn"));
I'm having a bit of difficulty finding the equivalent of "Any()" in powershell and I don't want to go through the awkwardness of calling the extension method.
So far I've got this:
gci | ? {$_.PsIsContainer} | gci -force | ? {$_.PsIsContainer -and $_.Name -eq "_svn" -or $_.Name -eq ".svn"
This finds me the svn directories themselves but not their parent directories - which is what I want. Bonus points if you can tell me why adding
| select-object {$_.Directory}
to the end of that command list simply displays a sequence of blank lines.