Get-WsusUpdate
Gets the WSUS update object with details about the update.
Syntax
Get-WsusUpdate
[-UpdateServer <IUpdateServer>]
-UpdateId <Guid>
[-RevisionNumber <Int32>]
[<CommonParameters>]
Get-WsusUpdate
[-UpdateServer <IUpdateServer>]
[-Classification <WsusUpdateClassifications>]
[-Approval <WsusApprovedState>]
[-Status <WsusUpdateInstallationState>]
[<CommonParameters>]
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 returns 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 are returned.
Examples
Example 1: Get updates by status
PS C:\> Get-WsusUpdate -Classification All -Approval Unapproved -Status FailedOrNeeded
This command gets all unapproved updates with a status of failed or needed.
Example 2: Get critical unapproved updates
PS C:\> Get-WsusUpdate -Classification Critical -Approval Unapproved -Status Any
Title Classification Installed/Not Applicable Approved
Percentage
----- -------------- ----------------------------- --------
Windows XP Update Package, Critical Updates NotApproved
October 25, 2001
This command gets all critical unapproved updates.
Parameters
-Approval
Specifies the approved state of the one or more updates to be returned. The acceptable values for this parameter are:
- Unapproved
- Declined
- Approved
- AnyExceptDeclined
Type: | WsusApprovedState |
Accepted values: | Approved, Unapproved, AnyExceptDeclined, Declined |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Classification
Specifies the classification of updates for which you want to get updates. The acceptable values for this parameter are:
- All
- Critical
- Security
- WSUS
Type: | WsusUpdateClassifications |
Accepted values: | All, Critical, Security, WSUS |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RevisionNumber
Specifies the revision number of a specific revision of an update. To specify the latest revision, set to zero.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Status
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
Type: | WsusUpdateInstallationState |
Accepted values: | NoStatus, InstalledOrNotApplicable, InstalledOrNotApplicableOrNoStatus, Failed, Needed, FailedOrNeeded, Any |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UpdateId
Specifies the update by its GUID. The GUID uniquely identifies the Windows Update package.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UpdateServer
Specifies the object that contains the WSUS server. This value is obtained by calling the Get-WsusServer cmdlet and passing the resulting IUpdateServer object into this cmdlet.
Type: | IUpdateServer |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Microsoft.UpdateServices.Administration.IUpdateServer
Outputs
Microsoft.UpdateServices.Commands.WsusUpdate