How to deploy a sandbox solution using Powershell in SharePoint 2010


In this article we will be seeing how to add, install, uninstall and remove the sandbox solution using powershell commands.

Add a user solution to the site:

Add-SPUserSolution -LiteralPath "E:\Vijai\SandboxTest\SandboxTest\bin\Debug\SandboxTest.wsp" -Site http://servername:2012/sites/welcome/

Sandbox solution is added to the site successfully as shown in the following.

sandbox1.gif
 
Install the user solution:

Install-SPUserSolution -Identity SandboxTest.wsp -Site http://servername:2012/sites/welcome/

Sandbox solution is activated successfully as shown in the following.

sandbox2.gif 

Uninstall the user solution:

Uninstall-SPUserSolution -Identity SandboxTest.wsp -Site http://servername:2012/sites/welcome/

Remove the user solution:

Remove-SPUserSolution -Identity SandboxTest.wsp -Site http://servername:2012/sites/welcome/