TestimoX

API Reference

Command

Get-CxPerfCounter

Namespace ComputerX.PowerShell
Outputs
ComputerX.Diagnostics.PerfCounterResult

Returns a normalized performance counter reading for a supported metric.

Examples

Authored help example

Example 1: Reads the local CPU utilization percentage.

PS>


Get-CxPerfCounter -Name CpuPercent
        

Example 2: Queries available memory on a remote server and forces the CIM-backed path.

PS>


Get-CxPerfCounter -Name AvailableMemoryMb -ComputerName SQL01 -PreferCim
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Get-CxPerfCounter -Name <string> [-ComputerName <string>] [-NoFallback] [-PreferCim] [<CommonParameters>]
#

Parameters

Name string requiredposition: 0pipeline: false
Name identifier for the target resource.
ComputerName string optionalposition: 1pipeline: false
Target computer name. Use . for the local machine or provide a DNS/NetBIOS name. When omitted, the local computer is queried.
NoFallback SwitchParameter optionalposition: namedpipeline: false
Disables fallback behavior if the preferred collector cannot return the requested metric.
PreferCim SwitchParameter optionalposition: namedpipeline: false
Prefers the CIM-backed collector when both native and CIM query paths are available.

Outputs

ComputerX.Diagnostics.PerfCounterResult