如何使用PowerShell使用CIM实例获取正在运行的进程?

您也可以使用GetCimInstance命令将WMI对象使用的类Win32_Process相同,在计算机上显示正在运行的进程。

命令

Get-CimInstance Win32_Process

输出结果

ProcessId Name                HandleCount WorkingSetSize VirtualSize
--------- ----                ----------- -------------- -----------
0         System Idle Process 0           8192           8192
4         System              6387        970752         5177344
96        Registry            0           76951552       173195264
568       smss.exe            53          495616         2203359674368
800       csrss.exe           883         4653056        2203416825856
896       csrss.exe           817         5349376        2203449389056
920       wininit.exe         156         4886528        2203387420672
956       winlogon.exe        264         9486336        2203423092736
8         services.exe        838         10129408       2203391979520
684       lsass.exe           1870        20848640       2203418796032