list files based on conditions

Occasional Visitor

Need to list files  from multiple paths with its full path, date & time info. The condition is it has to exclude files owned by a specific user and also exclude files from certain folders

1 Reply


Try this quick one


Get-ChildItem $Paths -Recurse | get-acl | where {($_.path -notlike "*\dontInclude\*") -and ($_.Owner -notlike "*System*")}