Test-PerformanceCounter

Tests if a performance counter exists.

Syntax

Test-PerformanceCounter [-CategoryName] <String> [-Name] <String> [<CommonParameters>]

Description

Returns True if counter Name exists in category CategoryName. False if it does not exist or the category doesn't exist.

Parameters

Name Type Description Required? Pipeline Input Default Value
CategoryName String

The category's name where the performance counter exists. Or might exist. As the case may be.

true false
Name String

The performance counter's name.

true false

EXAMPLE 1

Test-PerformanceCounter -CategoryName 'ToyotaCamry' -Name 'MilesPerGallon'

Returns True if the ToyotaCamry performance counter category has a MilesPerGallon counter. False if the counter doesn't exist.