Powershell 查询性能计数器



有没有更好的方法来列出特定进程的计数器属性:

$pids = get-counter -listset process | get-counter -maxsamples 1 | select -expandproperty countersamples | where {$_.path -like "w3wp"} | select cookedvalue | ForEach {$_.cookedvalue}

您也可以使用 WMI 类 "Win32_PerfFormattedData_PerfProc_Process" 来执行此操作:

Get-WmiObject -Class Win32_PerfFormattedData_PerfProc_Process -Filter "Name='w3wp'"

这将为您提供与 w3wp 进程相关的性能计数器数据。

最新更新