commands

^

Get-DbaPfDataCollectorCounter

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbaPfDataCollectorCounter on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaPfDataCollectorCounter.

Synopsis

Gets Performance Counters.

Description

Gets Performance Counters.

Syntax

Get-DbaPfDataCollectorCounter
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [[-CollectorSet] <String[]>]
    [[-Collector] <String[]>]
    [[-Counter] <String[]>]
    [[-InputObject] <Object[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaPfDataCollectorCounter

Gets all counters for all Collector Sets on localhost.

Example: 2
PS C:\> Get-DbaPfDataCollectorCounter -ComputerName sql2017

Gets all counters for all Collector Sets on on sql2017.

Example: 3
PS C:\> Get-DbaPfDataCollectorCounter -ComputerName sql2017 -Counter '\Processor(_Total)\% Processor Time'

Gets the '\Processor(_Total)% Processor Time' counter on sql2017.

Example: 4
PS C:\> Get-DbaPfDataCollectorCounter -ComputerName sql2017, sql2016 -Credential ad\sqldba -CollectorSet 'System Correlation'

Gets all counters for the 'System Correlation' CollectorSet on sql2017 and sql2016 using alternative credentials.

Example: 5
PS C:\> Get-DbaPfDataCollectorSet -CollectorSet 'System Correlation' | Get-DbaPfDataCollector | Get-DbaPfDataCollectorCounter

Gets all counters for the 'System Correlation' CollectorSet.

Optional Parameters

-ComputerName

The target computer. Defaults to localhost.

Alias
Required False
Pipeline false
Default Value $env:COMPUTERNAME
-Credential

Allows you to login to servers using alternative credentials. To use: $scred = Get-Credential, then pass $scred object to the -Credential parameter.

Alias
Required False
Pipeline false
Default Value
-CollectorSet

The Collector Set name.

Alias DataCollectorSet
Required False
Pipeline false
Default Value
-Collector

The Collector name.

Alias DataCollector
Required False
Pipeline false
Default Value
-Counter

The Counter name to capture. This must be in the form of '\Processor(_Total)% Processor Time'.

Alias
Required False
Pipeline false
Default Value
-InputObject

Accepts the object output by Get-DbaPfDataCollectorSet via the pipeline.

Alias
Required False
Pipeline true (ByValue)
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False