Hi!
I just started to learn PoweShell and I havn't really done any scripting prior to this. So far I am just trying to learn general PowerShell syntax, how to work with objects...
I created a script that will search your current folder and all subfolders for files. And for each file it finds it will print the path + filename, the owner of the file and the ACL of the file. I guess the script works but my question is, is this an efficient way to accomplish this? Or is this something you would normaly write a oneline script for?
The script look like this
$recursiveChildItems = Get-ChildItem -Recurse
foreach ( $childItem in $recursiveChildItems )
{
$owner = Get-Acl $childItem.FullName | Select-Object Owner
$acl = Get-Acl $childItem.FullName | Select-Object AccessToString
Write-Host "File:" `t $childItem.FullName
Write-Host "Owner:" `t $owner.Owner
Write-Host "ACL:" `t `t $acl.AccessToString
Write-Host `n
}
Regards
Erik