Powershell: 获取Windows任务管理器进程信息(进程ID、名称、状态、用户名、优先级、描述)
Get-WmiObject -Class Win32_Process | Sort-Object ProcessId | ForEach-Object { $task = (tasklist /FI 'PID eq $($.ProcessId)' /FO CSV | ConvertFrom-Csv); [PsCustomObject]@{ ProcessId = $.ProcessId; Name = $.Name; Priority = $.Priority; Status = $task.Status; UserName = $task.'User Name'; Description = $task.Description } }
原文地址: https://www.cveoy.top/t/topic/oKTU 著作权归作者所有。请勿转载和采集!