Commands / Files

Get-Acl

See who can access a file or folder

intermediate Files

Get-Acl
 (Get-Acl -Path .\docs).Access | Select-Object IdentityReference, FileSystemRights, AccessControlType
Works on
Windows
PowerShell
5.1 and later
Reference
Microsoft Learn: Get-Acl

Every file and folder on Windows has an access control list (ACL): who is allowed to read, change, or fully control it. Get-Acl reads that list.

The .Access property holds one row per rule:

.Owner tells you who owns the item.

Try this

(Get-Acl -Path .\docs).Owner
(Get-Acl -Path .\docs).Access | Where-Object IdentityReference -like '*Users*'

Changing permissions with Set-Acl is easy to get wrong and can lock you out. For one-off changes, the Security tab in the folder's Properties is safer.

Coming from another shell

ShellWhat you might type
bash / zshls -ld docs
cmd.exeicacls docs

More in From bash and From cmd.

Related commands