Come and Check our BETA Alpha version of Powershellcenter.net
Send me your comment to Powershell@powershellcenter.com

Synopsis

Upgrades a deployed SharePoint solution.

Syntax

Update-SPSolution [-Identity] <SPSolutionPipeBind> -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>] [-CASPolicies <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-FullTrustBinDeployment <SwitchParameter>] [-GACDeployment <SwitchParameter>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]

Detailed Description

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. For permissions and the most current information about Windows PowerShell for SharePoint Products, see the online documentation at http://go.microsoft.com/fwlink/p/?LinkId=251831 (http://go.microsoft.com/fwlink/p/?LinkId=251831).

Parameters

-Identity [<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.

Required?   True
Position?   1
Default value?  
Accept pipeline input?   True
Accept wildcard characters?   False

-LiteralPath [<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

Required?   True
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-AssignmentCollection [<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.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   True
Accept wildcard characters?   False

-CASPolicies [<SwitchParameter>]

Specifies that Code Access Security (CAS) policies can be deployed for the new SharePoint solution.

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-Confirm [<SwitchParameter>]

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-Force [<SwitchParameter>]

Forces the deployment of the new SharePoint solution.

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-GACDeployment [<SwitchParameter>]

Specifies that the new SharePoint solution can be deployed to the global assembly cache (GAC).

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-Local [<SwitchParameter>]

Deploys the solution on the local computer only.

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-Time [<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.

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

-WhatIf [<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

Required?   False
Position?   Named
Default value?  
Accept pipeline input?   False
Accept wildcard characters?   False

Notes

Examples

EXAMPLE

PS> C:\PS>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.