PowerCLI Reference

Get-Patch

Synopsis

This cmdlet retrieves the available patches.

Syntax

Get-Patch [[-SearchPhrase] <String[]>] [-Id <Int32[]>] [-Baseline <Baseline[]>] [-Severity <PatchSeverity[]>] [-Product <String[]>] [-After <DateTime>] [-Before <DateTime>] [-TargetType <PatchTargetType[]>] [-Vendor <String[]>] [-InstallationImpact <PatchInstallationImpact[]>] [-BundleType <PatchBundleType[]>] [-Category <UpdateCategory[]>] [<CommonParameters>]
Get-Patch [-Server <VIServer[]>] [[-SearchPhrase] <String[]>] [-Id <Int32[]>] [-Severity <PatchSeverity[]>] [-Product <String[]>] [-After <DateTime>] [-Before <DateTime>] [-TargetType <PatchTargetType[]>] [-Vendor <String[]>] [-InstallationImpact <PatchInstallationImpact[]>] [-BundleType <PatchBundleType[]>] [-Category <UpdateCategory[]>] [<CommonParameters>]

Related Commands

Online version
Copy-Patch
Sync-Patch

Detailed Description

This cmdlet retrieves all available patches or those specified by the provided cmdlet parameters.

Parameters

NameDescriptionRequired?Pipeline InputDefault Value
SearchPhraseSpecifies phrases that are contained in the Name, Description, Id, and Vendor properties of the patches you want to retrieve. Use commas to separate multiple phrases.falsefalse
IdSpecifies the IDs of the patches you want to retrieve.

Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
falsefalse
BaselineSpecifies baselines to which the patches you want to retrieve belong.falsetrue (ByValue)
SeveritySpecifies the severity of the patches you want to retrieve. The valid values are NotApplicable, Low, Moderate, Important, Critical, HostGeneral, and HostSecurity.falsefalse
ProductSpecifies the names of software products for which you want to retrieve patches.falsefalse
AfterIndicates that you want to retrieve only patches released after the date specified by this parameter.falsefalse
BeforeIndicates that you want to retrieve only patches released before the date specified by this parameter.falsefalse
TargetTypeSpecifies the target type of the patches you want to retrieve. The valid value is Host. This parameter is deprecated and will be removed in a following release.falsefalse
VendorSpecifies the vendors of the patches you want to retrieve.falsefalse
InstallationImpactSpecifies the installation impact of the patches you want to retrieve. The valid values are HostdRestart, Reboot, MaintenanceMode, MaintenanceModeHostdRestart, MaintenanceModeInstall, MaintenanceModeUpdate, and FaultToleranceCompatibiliy.falsefalse
BundleTypeSpecifies the bundle type of the patches you want to retrieve. The valid values are Patch, Rollup, Update, Extension, and Upgrade.falsefalse
CategorySpecifies the categories of the patches you want to retrieve. The valid values are SecurityFix, BugFix, Enhancement, and Other.falsefalse
ServerSpecifies the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers.falsetrue (ByValue)

Return Type

VMware.VumAutomation.Types.Patch[]

Notes

Examples

-------------- Example 1 --------------

Get-Patch -SearchPhrase "ESX40-MMODE" -Severity critical -Product "esx 4.0.*" -After 10.11.2007

Retrieves the critical esx 4.0.* patches released after 10.11.2007, that contain "ESX40-MMODE" in their properties.

-------------- Example 2 --------------

Get-Baseline -Id 2| Get-Patch

Retrieves all Patch objects included in the baseline with ID 2.

-------------- Example 3 --------------

Get-Patch -Severity critical -InstallationImpact Reboot

Retrieves the critical host patches whose installation reboots the host.


Copyright © 1998 - 2015 VMware, Inc. All rights reserved.