check users in $directory recursive and if no files contain extension JPG,PNG etc then run the results with sigcheck excluding those files?
$directory = dir E:\Users
$SigcheckPath = "C:\Windows\temp\sigcheck.exe"
$path1 = "download"
$path2 = "documents"
foreach ($dir in $directory) {
$filepath = Get-ChildItem E:\Users\$dir\downloads -recurse | where {! $_.PSIsContainer}
foreach ($file in $filepath) {
if ($file -notmatch '.jpg|.png|.gif') {
& $SigcheckPath -nobanner -a -h -s -v -vt -c F:\Users\$dirz\downloads > C:\Users\Admin\Desktop\$dir.csv
}
}
}
It should give output to a single file with .csv all the results for user for that specific directory!