Thursday, January 24, 2013

Extracting Solution Packages from SharePoint 2010 via PowerShell

There may come times when it becomes necessary to synchronize your SharePoint farms. In my experience, solution packages are virtual moving targets where developers apply changes willy-nilly. Thus, piecing together the contents of a solution package becomes a tedious and cumbersome task that distracts you from other time-sensitive projects.

Well, to speed up the process, you can use a shorthand approach by simply extracting the solution packages deployed to their respective content databases. How you ask? By way of Powershell. Here goes:
$solutions = [Microsoft.SharePoint.Administration.SPFarm]::Local.Solutions;

foreach ($solution in $solutions) {
        $solution.SolutionFile.SaveAs("c:\temp\packages\" + $solution.Name);
}

No comments:

Post a Comment