【发布时间】:2020-09-07 10:33:44
【问题描述】:
Powershell 初学者在这里使用 Powershell 4.0 在气隙 Win7 环境中工作,因此无法导入任何模块或执行任何复杂的操作,但想知道如何生成网络上运行特定进程的计算机的 txt 文件,说 wusa.exe 用于 Windows 更新?
我已经有一个所有计算机名称的 txt 列表,到目前为止有这个:
$computers = gc "C:\PCList.txt"
foreach ($computer in $computers) {Get-process | out-file -Path "C:\TheseAreRunningWusa.txt"}
但显然它显示了所有进程,有什么方法可以删除除特定进程之外的所有内容,但也只列出运行所述进程的进程?
提前致谢。
【问题讨论】:
标签: windows powershell windows-7 powershell-4.0