Deploy SharePoint wsp solution package using PowerShell

Add and Deploy SharePoint solutions

Deploying custom wsp in SharePoint FARM are done in 2 steps - Adding solution, Deploying/Installing solution. These PowerShell commands will work with SharePoint 2010 and SharePoint 2013. For older versions like MOSS 2007, you need to use STSATM commands.

Verify and make sure the account has necessary permissions and SharePoint Management Shell is run as Administrator.

Add solution - Add-SPSolution

Add the wsp solution package to the SharePoint FARM solution database. This is required before deploying the package.

Add-SPSolution -LiteralPath 
Deploy solution - Install-SPSolution

The solution deployment command varies a bit based on the criteria whether it's for a particular web application or all web applications.

The deployment process can be done via Central Admin too.

[Deploy to single Web Application]
Install-SPSolution -Identity  -WebApplication 

[Deploy to all Web Applications]
Install-SPSolution -Identity  -AllWebApplications -GACDeployment
Add-SPSolution -LiteralPath "C:\WSP\Code2CareSolution.wsp"

Install-SPSolution -Identity Code2CareSolution.wsp -WebApplication ""
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.