Get-PerformanceCounter

Get-PerformanceCounter

Gets performance counters.

Syntax

Parameter Set: FromMonitoringObjectProviderPath
Get-PerformanceCounter [[-Path] <String[]> ] [ <CommonParameters>]

Parameter Set: FromCriteria
Get-PerformanceCounter [-Criteria] <String> [[-Path] <String[]> ] [ <CommonParameters>]

Parameter Set: FromId
Get-PerformanceCounter [-Id] <Guid> [[-Path] <String[]> ] [ <CommonParameters>]

Detailed Description

Gets performance counters. You can get a specific counter by its identifier or filter the counters returned by using criteria expressed in System Center Operations Manager (SCOM) criteria expression syntax.

Parameters

-Criteria<String>

Specifies criteria using syntax designed for use with System Center Operations Manager. Only performance counters that meet the specified criteria will be retrieved. To learn about the syntax, consult the SDK topic, "Criteria Expression Syntax", in the System Center Operations Manager 2007 SDK. You can find the SDK by search Microsoft Developer Network (MSDN) online at https://msdn.microsoft.com.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Id<Guid>

Specifies the GUID of the performance counter to retrieve.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Path<String[]>

Specifies the paths to monitoring objects for which to retrieve performance counters. To enter multiple values, separate them by using commas.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Notes

  • For more information, type "Get-Help Get-PerformanceCounter -detailed". For technical information, type "Get-Help Get-PerformanceCounter -full".
    When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

Examples

-------------- EXAMPLE 1 --------------

This command gets the performance counter with the id <GUID>.

C:\PS>get-performancecounter -id <GUID>

-------------- EXAMPLE 2 --------------

This command uses Get-PerformanceCounter to retrieve performance counters for the monitoring objects associated with the current path. It then passes the resulting performance counters along the pipeline to Format-Table which selects three properties of the counters and displays them in a tabular format.

C:\PS>get-performancecounter |
format-table monitoringobjectpath,objectname,countername

Get-PerformanceCounterValue