Upgrade a Deployed Solution

Scenario/Problem: You have an updated solution package that needs to be deployed to SharePoint.

Solution: Use the Update-SPSolution cmdlet with a solution variable.

The Update-SPSolution cmdlet enables you to upgrade a previously deployed solution with a newer version of the solution package (and underlying files). Use this in conjunction with the Get-SPSolution cmdlet (explained in a previous section), as shown in Listing 9.8.

Listing 9.8. Sample Configuration Script for Upgrading a Solution

$solution = Get-SPSolution-Identity c0e31dec-294d-4f2d-9ae4-f2e637c766bdUpdate-SPSolution $solution -LiteralPath "c:\newsolution.wsp" -Force-GACDeployment

The -LiteralPath determines the location of the updated solution package. ...

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.