Description

When using Performance Monitor it can be useful to have a list of available counters and their descriptions. While the counter descriptions are available in the Performance Monitor user interface, having them all in one list can be easier to consume.

The script relies on the .NET objects and does not use the Get-Counter cmdlet which is only available in PowerShell 2.0. So in theory this should work on all versions of Windows that support at least PowerShell 1.0.

The script queries both the single instance and multi instance counters, determines the unique counters, exports them to CSV, then opens the CSV file with whatever program is associated with CSV files (which is likely Excel if you have Excel installed).

See also:

http://mow001.blogspot.com/2005/12/getting-performancemonitor-info-from.html

Script

PowerShell
Edit|Remove
$SingleInstanceCategories = [System.Diagnostics.PerformanceCounterCategory]::GetCategories() | Where-Object {$_.CategoryType -eq "SingleInstance"$MultiInstanceCategories = [System.Diagnostics.PerformanceCounterCategory]::GetCategories() | Where-Object {$_.CategoryType -eq "MultiInstance"} 
 
$SingleInstanceCounters = $SingleInstanceCategories | ForEach-Object {(new-object System.Diagnostics.PerformanceCounterCategory($_.CategoryName)).GetCounters() | Select-Object Categoryname,Countername,Counterhelp} 
 
Foreach ($Category in $MultiInstanceCategories)  
{ 
    $MultiInstanceCounters +$Category.GetInstanceNames() | Foreach-Object {$Category.GetCounters($_| Select-Object Categoryname,Countername,Counterhelp} 
} 
 
$MultiInstanceCounters = $MultiInstanceCounters | Sort-Object Countername -Unique 
 
$AllCounters = $MultiInstanceCounters + $SingleInstanceCounters 
 
$AllCounters | Sort-Object Categoryname,Countername | Export-Csv $env:temp\Counters.csv -NoTypeInformation 
 
Invoke-Item $env:temp\counters.csv