Reputation: 4562
Is there a better way to list counter properties for a particular process:
$pids = get-counter -listset process | get-counter -maxsamples 1 | select -expandproperty countersamples | where {$_.path -like "w3wp"} | select cookedvalue | ForEach {$_.cookedvalue}
Upvotes: 0
Views: 1007
Reputation: 25800
You can use WMI class "Win32_PerfFormattedData_PerfProc_Process" to do this as well:
Get-WmiObject -Class Win32_PerfFormattedData_PerfProc_Process -Filter "Name='w3wp'"
This will give you the performance counter data pertaining to w3wp processes.
Upvotes: 1