DaveWentzel.com            All Things Data

PerfMon Examples

 

$perf = New-Object System.Diagnostics.PerformanceCounter
$perf.CategoryName = 'Processor'
$perf.CounterName = '% Processor Time'
$perf.InstanceName = '_Total'
$perfv = $perf.NextValue()
$mem = New-Object System.Diagnostics.PerformanceCounter
$mem.CategoryName = 'Memory'
$mem.CounterName = 'Available MBytes'
$prc = New-Object System.Diagnostics.PerformanceCounter
$prc.CategoryName = 'System'
$prc.CounterName = 'Processor Queue Length'
 
 

Add new comment