Using the following Powershell code, I am trying to find folders that DO NOT contain robots.txt in the root. Typically, I could do this recursively, but he adopted FOREVER to restore this massive folder structure. I really need only the first level, AKA is only looking for folders found in C: \ Projects.
Basically, I need to get children from each set of children, and only then return them to parents where there was no robots.txt file. The problem I came across here is my $ _ in a nested loop that gives me CWD, and not the children of the directory I'm looking for. I know that I may have to use "Somewhere here, but I'm a little overhead and quite new to powershell. Any help is appreciated!
$drv = gci C:\Projects | %{ $parent = $_; gci -exclude "robots.txt" | %{$_.parent}} | gu
source share