Testing inventory objects for compliance with baselines
If you want to know whether your inventory objects are up to date or have missing patches, you can use the Test-Compliance
cmdlet to test inventory objects for compliance with baselines attached to them. The syntax of the Test-Compliance
cmdlet is as follows:
Test-Compliance [-Server <VIServer[]>] [-Entity] <InventoryItem[]>
[[-UpdateType] <UpdateType[]>] [-RunAsync] [-WhatIf] [-Confirm]
[<CommonParameters>]
The -Entity
parameter is required. You can use the -UpdateType
parameter to specify the type of the patches and upgrades you want to scan. The valid values are: HostPatch
, HostUpgrade
, HostThirdParty
, VmPatch
, VmHardwareUpgrade
, VmToolsUpgrade
, and VaUpgrade
. The VmPatch
value is deprecated and will be removed in a following release of PowerCLI.
In the first example, we will scan all the hosts in the New York
data center for missing patches:
PowerCLI C:\> Test-Compliance -UpdateType HostPatch...