## PowerCLI Reference

# Get-PatchBaseline

## Synopsis

This cmdlet retrieves patch baselines.

Syntax

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
New-PatchBaseline
Set-PatchBaseline

Detailed Description

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

Parameters

Name | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | ---
TargetType | Specifies 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. | false | false |
Patch | Specifies a patch that belongs to the patch baseline you want to retrieve. | false | true (ByValue) |
BaselineContentType | Specifies the content type of the patch baselines you want to retrieve. The valid values are Both, Dynamic, and Static. | false | false |
Extension | Specifies that you want to retrieve only Extension patch baselines. | false | false |
Name | Specifies the names of the patch baselines you want to retrieve. | false | false |
Id | Specifies 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. | false | false |
Server | 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. | false | true (ByValue) |
Entity | Specifies Template, VirtualMachine, VMHost, Cluster, Datacenter, Folder, and VApp objects to which the baselines you want to retrieve are attached to. | false | true (ByValue) |
Inherit | Specifies that you want to retrieve the baselines inherited by the parent inventory entities. | false | false |
Recurse | If set, retrieves the patch baselines attached to the child entities. This parameter can be specified only if the -Entity parameter is set, too. | false | false |

Return Type

VMware.VumAutomation.Types.PatchBaseline[]

Notes

Examples

-------------- 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.