Retrieving baseline compliance data
After scanning your inventory objects against one or more baselines for missing patches or upgrades, you can use the Get-Compliance
cmdlet to retrieve the compliance data. The syntax of the Get-Compliance
cmdlet is as follows:
Get-Compliance [-Server <VIServer[]>] [-Entity] <InventoryItem> [-ComplianceStatus <ComplianceStatus>] [-Baseline <Baseline[]>] [-Detailed] [<CommonParameters>]
The -Entity
parameter is required.
In the following example, we will retrieve the compliance status for the hosts in the cluster Cluster01
against the Critical Host Patches (Predefined)
baseline:
PowerCLI C:\> $Baseline = Get-Baseline -Name 'Critical Host Patches (Predefined)' PowerCLI C:\> Get-Compliance -Entity (Get-Cluster -Name 'Cluster01') -Baseline $Baseline
The output of the preceding commands is as follows:
Entity Baseline Status ------ -------- ...