输出exe使用的所有DLL的脚本

时间:2018-05-18 07:59:25

标签: python powershell dll cmd exe

在cmd中行

tasklist /m /fi "imagename eq xxxxx.exe" > output.txt

会将所有进程使用的DLL输出到一个文件中。

如何将输出分隔为多个txt文件,每个文件包含DLL使用的进程名称?

1 个答案:

答案 0 :(得分:2)

这可以让你得到你想要的东西:

Get-Process |
    ForEach-Object {
        $procName = $_.Name
        Get-Process -InputObject $_ -Module -ErrorAction SilentlyContinue |
            Export-Csv ".\$procName.csv" -NoTypeInformation
    }
相关问题