PowerCLI Reference



This cmdlet retrieves patch baselines.


Get-PatchBaseline [[-TargetType] <BaselineTargetType>] [-Patch <Patch>] [-BaselineContentType <BaselineContentType[]>] [-Extension] [[-Name] <String[]>] [-Id <Int32[]>] [<CommonParameters>]
Get-PatchBaseline [[-TargetType] <BaselineTargetType>] [-BaselineContentType <BaselineContentType[]>] [-Extension] [-Server <VIServer[]>] [[-Name] <String[]>] [-Id <Int32[]>] [-Entity <InventoryItem[]>] [-Inherit] [-Recurse] [<CommonParameters>]

Related Commands

Online version

Detailed Description

This cmdlet retrieves all patch baselines or those specified by the provided cmdlet parameters.


NameDescriptionRequired?Pipeline InputDefault Value
TargetTypeSpecifies the target type of the patch baselines you want to retrieve. The valid value is Host. This parameter is deprecated and will be removed in a following release.falsefalse
PatchSpecifies a patch that belongs to the patch baseline you want to retrieve.falsetrue (ByValue)
BaselineContentTypeSpecifies the content type of the patch baselines you want to retrieve. The valid values are Both, Dynamic, and Static.falsefalse
ExtensionSpecifies that you want to retrieve only Extension patch baselines.falsefalse
NameSpecifies the names of the patch baselines you want to retrieve.falsefalse
IdSpecifies the IDs of the patch baselines 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.
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)
EntitySpecifies Template, VirtualMachine, VMHost, Cluster, Datacenter, Folder, and VApp objects to which the baselines you want to retrieve are attached to.falsetrue (ByValue)
InheritSpecifies that you want to retrieve the baselines inherited by the parent inventory entities.falsefalse
RecurseIf set, retrieves the patch baselines attached to the child entities. This parameter can be specified only if the -Entity parameter is set, too.falsefalse

Return Type




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

Get-VM -Name VMHost | Get-PatchBaseline

Retrieves all patch baselines assigned to the VMHost host.

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

Get-PatchBaseline -Entity VMHost -Inherit -Recurse

Retrieves all patch baselines assigned to the VMHost host and its parent inventory object.

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

$patch = Get-Patch -Id 1 

Get-PatchBaseline -Patch $patch

Retrieves the patch baselines that contain the patch with ID 1.

-------------- Example 4 --------------

Get-PatchBaseline -Id 1,2,3

Retrieves the patch baselines with IDs 1, 2, and 3.

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