如何在 Windows 中使用 PowerShell 获取已打开应用程序的列表?


可以使用 Get-Process 命令,通过 PowerShell 获取 Windows 中已打开应用程序的列表。Get-Process 命令会显示前台和后台当前运行的进程。

如果我们直接运行 Get-Process 命令,它将会给出进程名称及其所关联的进程 ID、CPU 及内存使用情况。

PS C:\> Get-Process

如果查看 Get-Process 的成员,其中有一个 MainWindowsTitle 属性。该属性指示已打开应用程序的头衔。

在以下示例中,我们将找到应用程序名称、关联进程和应用程序 ID。例如,

Get-Process | Select MainWindowTitle,ProcessName,Id | where{$_.MainWindowTitle -ne ""}

我们需要筛选出空白头衔,因为它们可能已由后台进程使用。

更新时间:2020 年 11 月 20 日

4K+ 浏览

职业起步

完成课程认证

入门
广告
© . All rights reserved.