Retract a Solution

Scenario/Problem: You need to retract a deployed solution from a web application or global deployment.

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

The Uninstall-SPSolution cmdlet enables you to retract a specific solution that was previously deployed. Use this in conjunction with the Get-SPSolution cmdlet (explained in a previous section), as shown in Listing 9.5.

Listing 9.5. Retracting a Solution from a Web Application

$solution = Get-SPSolution-Identity c0e31dec-294d-4f2d-9ae4-f2e637c766bdUninstall-SPSolution $solution -WebApplication "SharePoint - 80"

Providing the -WebApplication parameter retracts the solution from the specified web application (assuming that the solution was deployed ...

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.