This project is read-only.

Get-MSIPatchInfo

Synopsis

Gets patch information for registered patches.

If a ProductCode is not specified, only basic information about patches will be returned.

Syntax

  • Get-MSIPatchInfo &#91;&#91;-PatchCode&#93; <String[]>&#93; &#91;-UserSid <String>&#93; &#91;-InstallContext <InstallContext>&#93; &#91;-Filter <PatchStates>&#93; &#91;-Everyone&#93;
  • Get-MSIPatchInfo &#91;&#91;-ProductCode&#93; <String[]>&#93; &#91;&#91;-PatchCode&#93; <String[]>&#93; &#91;-UserSid <String>&#93; &#91;-InstallContext <InstallContext>&#93; &#91;-Filter <PatchStates>&#93; &#91;-Everyone&#93;

Detailed Description

Gets patch information for a given patch or for all patches registered to a given product or products. You can get patch information for machine-registered patches, and patch information for both user-managed- and user-unmanaged-registered patches for the current or another user.

Parameters

-PatchCode <String[]>

The patch code or patch codes to retrieve patch information.

Required? false
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-UserSid <String>

The security identifier for a user for user-managed and user-unmanaged patches.

Required? false
Position? named
Default value Null
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-InstallContext <InstallContext>

The context for registered patches. This can be a combination of "Machine", "UserManaged", or "UserUnmanaged".

Required? false
Position? named
Default value Machine
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Filter <PatchStates>

The state or states of patches to be retrieved. This can be a combination of "Applied", "Superseded", "Obsoleted", "Registered", or "All".

Required? false
Position? named
Default value Applied
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Everyone

Whether to retrieve user-managed or user-unmanaged patches for everyone.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

-ProductCode <String[]>

Specifies the ProductCode or ProductCodes to get patch information.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

Return Type

  • Microsoft.Windows.Installer.PatchInfo: Registered information for a patch or patches.

Notes

Example 1

C:\PS> get-msipatchinfo

This command outputs a table of patch information for all applied patches on the machine.

Example 2

C:\PS> get-msipatchinfo -filter superseded | get-childitem

This command gets file information for superseded patches on the machine.

Example 3

C:\PS> get-msiproductinfo | where-object {$_.Name -match "Office"} | get-msipatchinfo -filter all

This command gets patch information for all patches applied to products with "Office" in the name.

Related Links

Last edited Feb 8, 2009 at 8:20 PM by heaths, version 2

Comments

No comments yet.