Get-WsusUpdate

Get-WsusUpdate

Gets the Windows Server Update Services (WSUS) update object with details about the update.

Syntax

Parameter Set: ID
Get-WsusUpdate -UpdateId <Guid> [-RevisionNumber <Int32> ] [-UpdateServer <IUpdateServer> ] [ <CommonParameters>]

Parameter Set: Scoped
Get-WsusUpdate [-Approval <WsusApprovedState> ] [-Classification <WsusUpdateClassifications> ] [-Status <WsusUpdateInstallationState> ] [-UpdateServer <IUpdateServer> ] [ <CommonParameters>]

Detailed Description

The Get-WsusUpdate cmdlet gets the Windows Server Update Services (WSUS) update object with details about the update. This cmdlet requires the update unique identifier (GUID) or a set of filter criteria such as classification, approval and status as parameter.

The Get-WsusUpdate cmdlet can be called in two ways:
-- Passing in the Update ID (GUID) and RevisionNumber. This cmdlet will return a single update matching the specified Update ID and revision number.
-- Passing in filter parameters. These parameters include Classification, Approval, and Status. One or more updates matching the specified criteria will be returned.

Parameters

-Approval<WsusApprovedState>

Specifies the approved state of the one or more updates to be returned. The acceptable values for this parameter are:
-- Unapproved
-- Declined
-- Approved
-- AnyExceptDeclined

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Classification<WsusUpdateClassifications>

Specifies the classification of updates for which you want to get updates. The acceptable values for this parameter are:
-- All
-- Critical
-- Security
-- WSUS

Aliases

none

Required?

false

Position?

named

Default Value

WUUpdateClassification.All

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RevisionNumber<Int32>

Specifies the revision number of a specific revision of an update. To specify the latest revision, set to zero.

Aliases

none

Required?

false

Position?

named

Default Value

0

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Status<WsusUpdateInstallationState>

Specifies the installation status for which to search. An update will be included only if it has at least one computer with the specified status. The acceptable values for this parameter are:
-- Needed
-- FailedOrNeeded
-- InstalledNotApplicableOrNoStatus
-- Failed
-- InstalledNotApplicable
-- NoStatus
-- Any

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UpdateId<Guid>

Specifies the update by its GUID. The GUID uniquely identifies the Group Policy Object (GPO).

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UpdateServer<IUpdateServer>

Specifies the object that contains the WSUS server. This value is obtained by calling the Get-WsusServer cmdlet and piping the resulting IUpdateServer object into this cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.UpdateServices.Commands.WsusUpdate

    WsusUpdate

Examples

EXAMPLE 1

This example gets allunapproved updates with a status of failed or needed.

PS C:\> Get-WsusUpdate -Classification All -Approval Unapproved -Status FailedOrNeeded

EXAMPLE 2

This example gets allcriticalunapproved updates.

PS C:\> Get-WsusUpdate -Classification Critical -Approval Unapproved -Status Any

Approve-WsusServer

Deny-WsusServer

Get-WsusServer