Get-Patch Command | Vmware PowerCLI Reference

Get-Patch

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

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
optional After DateTime named
Indicates that you want to retrieve only patches released after the date specified by this parameter.
optional Baseline Baseline[] named
  • pipeline
Specifies baselines to which the patches you want to retrieve belong.
optional Before DateTime named
Indicates that you want to retrieve only patches released before the date specified by this parameter.
optional BundleType PatchBundleType[] named
Specifies the bundle type of the patches you want to retrieve. The valid values are Patch, Rollup, Update, Extension, and Upgrade.
optional Category UpdateCategory[] named
Specifies the categories of the patches you want to retrieve. The valid values are SecurityFix, BugFix, Enhancement, and Other.
optional Id Int32[] named
Specifies 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.
optional InstallationImpact PatchInstallationImpact[] named
Specifies the installation impact of the patches you want to retrieve. The valid values are HostdRestart, Reboot, MaintenanceMode, MaintenanceModeHostdRestart, MaintenanceModeInstall, MaintenanceModeUpdate, and FaultToleranceCompatibiliy.
optional Product String[] named
Specifies the names of software products for which you want to retrieve patches.
optional SearchPhrase String[] named
Specifies 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.
optional Severity PatchSeverity[] named
Specifies the severity of the patches you want to retrieve. The valid values are NotApplicable, Low, Moderate, Important, Critical, HostGeneral, and HostSecurity.
optional TargetType PatchTargetType[] named
Specifies 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.
optional Vendor String[] named
Specifies the vendors of the patches you want to retrieve.
Get-Patch
[-After < DateTime > ]
[-Before < DateTime > ]
[-BundleType < PatchBundleType[] > ]
[-Category < UpdateCategory[] > ]
[-Id < Int32[] > ]
[-InstallationImpact < PatchInstallationImpact[] > ]
[-Product < String[] > ]
[-SearchPhrase < String[] > ]
[-Server < VIServer[] > ]
[-Severity < PatchSeverity[] > ]
[-TargetType < PatchTargetType[] > ]
[-Vendor < String[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional After DateTime named
Indicates that you want to retrieve only patches released after the date specified by this parameter.
optional Before DateTime named
Indicates that you want to retrieve only patches released before the date specified by this parameter.
optional BundleType PatchBundleType[] named
Specifies the bundle type of the patches you want to retrieve. The valid values are Patch, Rollup, Update, Extension, and Upgrade.
optional Category UpdateCategory[] named
Specifies the categories of the patches you want to retrieve. The valid values are SecurityFix, BugFix, Enhancement, and Other.
optional Id Int32[] named
Specifies 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.
optional InstallationImpact PatchInstallationImpact[] named
Specifies the installation impact of the patches you want to retrieve. The valid values are HostdRestart, Reboot, MaintenanceMode, MaintenanceModeHostdRestart, MaintenanceModeInstall, MaintenanceModeUpdate, and FaultToleranceCompatibiliy.
optional Product String[] named
Specifies the names of software products for which you want to retrieve patches.
optional SearchPhrase String[] named
Specifies 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.
optional Server VIServer[] named
  • pipeline
Specifies 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.
optional Severity PatchSeverity[] named
Specifies the severity of the patches you want to retrieve. The valid values are NotApplicable, Low, Moderate, Important, Critical, HostGeneral, and HostSecurity.
optional TargetType PatchTargetType[] named
Specifies 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.
optional Vendor String[] named
Specifies the vendors of the patches you want to retrieve.

Output

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.

Related Commands

Patch

This cmdlet initializes staging of patches.

This cmdlet retrieves the available patches.

This cmdlet downloads new patches into the Update Manager repository.

PatchBaseline

This cmdlet retrieves patch baselines.

This cmdlet creates a new patch baseline.

This cmdlet modifies the properties of a patch baseline.