使用 powershell 脚本的“文件和子文件夹所有者信息列表”

" list of files and subfoldes owner information" with powershell script

我可以看到一些 link"https://community.spiceworks.com/scripts/show/1722-get-fileowner"

我尝试了这些示例,但它们都不适合我。

这样就可以了

get-childitem c:\users\usera\documents -Recurse | foreach{
    $f = $_.FullName
    $o = Get-Acl $f | Select -ExpandProperty Owner
    Write-Output "$f is owned by $o"
}