Deploy Multiple Solutions

By James|December 30, 2011|

How do you deploy solutions to your SharePoint farm once you've added them to the solution store? Any of the following will work:

  • Use Central Administration GUI
  • Use STSADM -deploysolution
  • Use Install-SPSolution PowerShell cmdlet (SharePoint 2010)

But what if you are standing up a new farm or you've received a boatload of new web parts from your developers?  Deploying multiple solutions using any of the above methods will work, but will be slow, tedious and painful.

The following script will query the farm for all installed web parts that are in a non-deployed status and deploy them all.

USAGE

deploysolutions.ps1 -URL http://web_application_to_deploy_to

SCRIPT

# Title: DeploySolutions
# Version: 1.0, 28DEC11
# Author: James Sanders
# Purpose: Find all installed farm solutions that are not deployed and deploy them

# Command line parameters
Param([string]$URL)

If (!$URL) { Write-Host; Write-Host "No URL specified, aborting ..."; Exit;}
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue

$Solutions = Get-SPSolution | where {$_.Deployed -eq $FALSE}

ForEach ($Solution in $Solutions) {
  Write-Host "Installing Solution: $($Solution.Name) " -NoNewLine
  Install-SPSolution -Identity $Solution.Name -GACDeployment -CASPolicies -WebApplication $URL
  Do {Write-Host -NoNewline .;Start-Sleep 2;} while ($Solution.Deployed -ne $TRUE)
  Write-Host
}

 

 

Copyright 2011 - 2021 The Lazy SharePoint Admin | All Rights Reserved
menu-circlecross-circle linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram