This project contains an example to deploy multiple solutions in SharePoint 2010 using PowerShell. the script uses an prefilled xml file containing information for setting up your deployment easily on any server. Currently the script expects that your customer project contains a separate solution for the sitedefinitions and one ore more other solutions for installing any kind of features, components or page layouts. The script depends on a configuration xml file. The xml file looks as follow:

<?xml version="1.0" encoding="utf-8"?>
<Config>
<SolutionsFolder>c:\build</SolutionsFolder>
<WebApplication>
<WebApplicationURL>http://www.contoso.com</WebApplicationURL>
<WebApplicationName>Contoso</WebApplicationName>
<ApplicationPool>ContosoPool</ApplicationPool>
<ApplicationPoolAccount>corp\apppool</ApplicationPoolAccount>
<HostHeader>www.contoso.com</HostHeader>
</WebApplication>
<SiteDefinitionSolution>Contoso.SiteDefinitions.wsp</SiteDefinitionSolution>
<Database>
<DatabaseName>Contoso-Content</DatabaseName>
<DatabaseServer>CONTOSO-DB-01</DatabaseServer>
</Database>
<Solutions>
<Solution Scoped="TRUE">Contoso.Core.wsp</Solution>
<Solution Scoped="FALSE">Contoso.Design.wsp</Solution>
<Solution Scoped="FALSE">Contoso.Layouts.wsp</Solution>
</Solutions>
</Config>

The actual deployment PowerShell script contains some methods for retracting, deleting, installing and deploying solutions. It does the deployment as follow:

1) retracts and removes the solution containing the site definitions
2) installs and deploys the solution containing the site definitions
3) checks if the web application exists. If not it is created (without a site collection)
4) retracts and removes the other solutions (defined in the xml file)
5) installs and deploys the other solutions

This is the first release of the PowerShell script. It is currently in development. I'm working on deactivating / activating the features. I'm interested in any suggestions, help and other remarks.

Last but not least i want to thank some of the blogposts i have been reading about Powershell deployments. In particular the post of Stef van Hooijdonk as http://stefvanhooijdonk.com/2010/04/06/powershell-and-sp2010-2-installing-a-solution/

Last edited Sep 7, 2010 at 6:00 AM by ameijers, version 7