This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.

Update-MSIProduct

Synopsis

Update an installed product on the local or a remote computer.

Syntax

  • Update-MSIProduct [-Name] [-UpdatePackage] [-Options] [-ComputerName] [-Credential]

Description

The Update-MSIProduct cmdlet updates an installed products on the local or a remote computer.

Parameters

  • Name The name of the product to update. Names must be exact and this parameter does not accept wildcards.
  • UpdatePackage The qualified path to the update package MSI.
  • Options Any MSI installation options, in the format 'PROPERTY1=value1 PROPERTY2=value2', expressed as a single string.
  • ComputerName The computer against which to run the cmdlet. By default this parameter will be populated with the name of the local computer.
  • Credential The credentials under which to run the cmdlet. By default this cmdlet will run as the current user. Using this parameter and the Get-PSCredential cmdlet you can specify an alternate set of credentials under which to execute this command.

Inputs

Update-MSIProduct accepts pipeline input for the Name and ComputerName parameters by property name. This cmdlet also accepts the output of the Get-MSIProduct cmdlet as an input object.

Outputs

Update-MSIProduct makes changes directly to Windows and does not output any Powershell objects.

Notes

The Update-MSIProduct cmdlet requires that the Remote Registry and RPC services are started on the computer it is trying to access, that the WMI Windows Installer Provider is installed (it is an optional component in Windows 2003) and that DNS services are available to resolve target host names.

Example 1

This command will update the installed product "MyProduct V1" on the local computer using MyProduct.msi:

Update-MSIProduct -Name "MyProduct V1" -UpdatePackage C:\MSIs\MyProduct.msi

Example 2

This command will update the installed product "MyProduct V1" on the remote computer PC01using MyProduct.msi found on the local computer:

Update-MSIProduct -Name "MyProduct V1" -UpdatePackage C:\MSIs\MyProduct.msi -Computer PC01

Example 3

The Get-MSIProduct cmdlet can be used in conjunction with the Update-MSIProduct cmdlet. This command will update the MyProduct application on the remote computer PC01:

Get-MSIProduct -Name MyProduct* -Computer PC01 | Update-MSIProduct -UpdatePackage C:\MSIs\MyProduct.msi