Friday, April 15, 2011

Extract WSP from SharePoint Solution Store


using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

static void Main(string[] args)
{
const string extractingTo = "e:\\Solutions\\";
SPSolutionCollection solutions = SPFarm.Local.Solutions;
foreach (SPSolution solution in solutions)
{
Console.WriteLine("Extracting " + solution.Name);
SPPersistedFile wspFile = solution.SolutionFile;
wspFile.SaveAs(extractingTo + solution.Name);
}
}

No comments:

Post a Comment