I have separate Powershell commands I run, one gets me a list of all folders at a specific level, the other list all folders and associated ACLs. I'd like to combine then to list only "level 3" folders, and their associated ACLs. Command for level 3 folders is:
Get-ChildItem "I:" -Recurse -Directory | Where-Object {$_.FullName.split("\").count -le 4} | ForEach-Object FullName
Command for folder ACLs is:
Get-ChildItem j:\ -Recurse | where-object {($_.PsIsContainer)} | Get-ACL | Format-List
I tried:
Get-ChildItem I:\ -Recurse | where-object {($_.PsIsContainer)} | Where-Object {$_.FullName.split("\").count -le 4} Get-ACL | Format-List
But got error Where-Object : A positional parameter cannot be found that accepts argument 'Get-ACL'.
Thanks in advance for any help! Using PS 5.1, btw.