Share via


Scripting Installing/Removing/Updating Solutions on 2010

Here are the scripts replacing some of the legacy STSADM commands (borrowed content from Patrick's SharePoint Blog):

Add-SPSolution “D:\Deploy\MySharePointSolution.wsp“
Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication https://myspwebapp –GACDeployment

If you would like to add the solution as sandboxed, you would use the Install-SPUserSolution command instead. To upgrade a solution, we specify which solution is to be updated and with which new solution file:

Update-SPSolution –Identity MySharePointSolution.wsp –LiteralPath “D:\Deploy\MySharePointSolution.wsp” –GacDeployment

To retract and remove a solution, we use the following commands:

Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplicationhttps://myspwebapp
Remove-SPSolution–Identity MySharePointSolution.wsp

For more details, go to Patrick's SharePoint Blog