-notmatch'.JPG | .PNG'然后使用sigcheck扫描结果

时间:2019-07-17 15:53:10

标签: powershell security sysinternals

递归检查$ directory中的用户,如果没有文件包含扩展名JPG,PNG等,然后使用sigcheck运行结果,排除那些文件?

$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 
        }
    }
}

应将输出的结果全部输出到.csv单个文件中,以供特定目录的用户使用!

0 个答案:

没有答案