I'm trying to find all folders which do not inherit permissions.
This seems to work, sorta:
DIR "C:\temp" -directory -recurse | GET-ACL | select -ExpandProperty Access | ? -property IsInherited -eq $false
...but it leaves out the actual folder name.
How do I include folder names in the final output? It gets a little tricky for me because I need to filter on a property on an object (Access) within an object (whatever GET-ACL
returns).
Any ideas?
path
property in your select statement. Then you need to loop each path to replace the spurious extra data that Get-ACL includesMicrosoft.PowerShell.Core\FileSystem::
from each path. (you'll see)