API Reference
Command
Get-CxPerfCounter
Returns a normalized performance counter reading for a supported metric.
Examples
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
- Name identifier for the target resource.
- ComputerName string
- Target computer name. Use . for the local machine or provide a DNS/NetBIOS name. When omitted, the local computer is queried.
- NoFallback SwitchParameter
- Disables fallback behavior if the preferred collector cannot return the requested metric.
- PreferCim SwitchParameter
- Prefers the CIM-backed collector when both native and CIM query paths are available.
Outputs
ComputerX.Diagnostics.PerfCounterResult