Powershell Script that will deploy/upgrade Sandbox Solution.
Script that will let you deploy/upgrade a sandbox solution to a SharePoint 2010 site. Make sure that you at least an SharePoint site administrator before you run the script. # SharePoint DLL [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") #Cmdlet Install Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue ###REGION FUNCTIONS ##################################################################### #Adds a Sandbox solution to a site. ##################################################################### function AddSolution() { $myError = $null Add-SPUserSolution -LiteralPath $Solution -Site $SiteURL -ErrorAction:SilentlyContinue -ErrorVariable myError -Confirm:$false if ($myError -ne $null) { write-host -foregroundcolor 'red' $myError $myError = $null } else { Write-host -foregroundColor 'green' 'Sucessfuly added the solution to the site' } } ...