Remove a Solution from the SharePoint Farm

Scenario/Problem: You need to remove a solution from the SharePoint farm.

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

The Remove-SPSolution cmdlet enables you to remove a specific solution from the current farm. Use this in conjunction with the Get-SPSolution cmdlet (explained in a previous section), as shown in Listing 9.9.

Listing 9.9. Sample Configuration Script for Removing a Solution

$solution = Get-SPSolution-Identity c0e31dec-294d-4f2d-9ae4-f2e637c766bdRemove-SPSolution $solution

Note

You may not remove a solution that has been deployed. You must first retract the solution and then perform the removal operation.

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.