I am attempting to delete some orphaned folders. I have a list of folder names that are orphaned, and I am attempting to find the corresponding File object. Unfortuantely, I can't seem to get the -in clause to work as I would expect.
A slightly contrived example:
$orphans = ls | select Name
ls | ?{$_.Name -in $orphans}
ls -Include $orphans
No files are returned.