Retrieving statistical data

The Get-OMStat cmdlet retrieves statistical data from the specified vRealize Operations Manager server. The syntax of the Get-OMStat cmdlet is as follows:

Get-OMStat [-Resource] <OMResource[]> [-Key <OMStatKey[]>]
    [-From <DateTime>] [-To <DateTime>] [-IntervalType 
    <OMStatIntervalType>] [-IntervalCount <Int32>] [-RollupType 
    <OMStatRollupType>] [-Server <OMServer[]>] [<CommonParameters>]

The -Resource parameter is required.

In the first example, we will retrieve all of the statistical data for virtual machine DC001 and display the first five objects found, using the following command:

PowerCLI C:\> Get-OMStat -Resource DC001 | Select-Object -First 5

The output of the preceding command is as follows:

Resource Key Value ...

Get Learning PowerCLI - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.