Get-Metric

This cmdlet retrieves the available metrics on a vCenter Server system. The cmdlet returns a set of metrics that correspond to the filter criteria provided by the cmdlet parameters. To specify a server different from the default one, use the Server parameter.

Syntax

[-MetricGroup  <String[]>]
[-Name  <String[]>]
[-Server  <VIServer[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
MetricGroup
String[] named Specifies the metric groups of the metrics that you want to retrieve.
optional
Name
String[] named
  • wildcards
  • Specifies the names of the metrics that you want to retrieve.
    optional
    Server
    VIServer[] named
  • wildcards
  • Specifies the vSphere servers on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.

    Output

    VMware.VimAutomation.ViCore.Types.V1.Metric

    Examples


    Example 1

    Get-Metric

    Retrieves all available metrics.

    Example 2

    Get-Metric -Name "Usage*"

    Retrieves metrics with the name Usage.

    Example 3

    Get-Metric -MetricGroup "CPU" $server

    Retrieves all available metrics on the server that match the pattern.

    Example 4

    Get-Metric -Name "Usage" -MetricGroup "CPU"

    Retrieves all metrics with the name Usage from a metric group CPU.

    Related Commands

    Feedback

    Was this page helpful?