Update-SPSolution
Applies to: SharePoint Server 2010, SharePoint Foundation 2010
Topic Last Modified: 2011-01-21
Upgrades a deployed SharePoint solution.
Update-SPSolution [-Identity] <SPSolutionPipeBind> -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>] [-CASPolicies <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GACDeployment <SwitchParameter>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]
The Update-SPSolution cmdlet upgrades a deployed SharePoint solution in the farm. Use this cmdlet only if a new solution contains the same set of files and features as the deployed solution. If files and features are different, the solution must be retracted and redeployed by using the Uninstall-SPSolution and Install-SPSolution cmdlets, respectively.
| Parameter | Required | Type | Description | ||
|---|---|---|---|---|---|
| Identity | Required | Microsoft.SharePoint.PowerShell.SPSolutionPipeBind | Specifies the SharePoint solution to deploy. The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object. | ||
| LiteralPath | Required | System.String | Specifies the path to the solution package. The type must be a valid path in either of the following forms: - C:\folder_name - \\server_name\folder_name | ||
| AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentCollection | Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.
| ||
| CASPolicies | Optional | System.Management.Automation.SwitchParameter | Specifies that Code Access Security (CAS) policies can be deployed for the new SharePoint solution. | ||
| Confirm | Optional | System.Management.Automation.SwitchParameter | Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters | ||
| Force | Optional | System.Management.Automation.SwitchParameter | Forces the deployment of the new SharePoint solution. | ||
| GACDeployment | Optional | System.Management.Automation.SwitchParameter | Specifies that the new SharePoint solution can be deployed to the global assembly cache (GAC). | ||
| Local | Optional | System.Management.Automation.SwitchParameter | Deploys the solution on the local computer only. | ||
| Time | Optional | System.String | Specifies when the solution will be deployed. The default value is immediate deployment. The type must be a valid DateTime value, in the form 2010, 5, 1. | ||
| WhatIf | Optional | System.Management.Automation.SwitchParameter | Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters |
------------------EXAMPLE------------------
Update-SPSolution -Identity contoso_solution.wsp -LiteralPath c:\contoso_solution_v2.wsp -GACDeployment
This example upgrades the deployed SharePoint solution contoso_solution.wsp to the solution c:\contoso_solution_v2.wsp.

Note