Programatically download WSP from SharePoint 2010 Central Admin

Purposed solution:
  1. Using Console application to Extract WSP
  2. Using Power Shell Script
Implementation:

Using Console Application to Extract WSP
SPSolutionCollection solutions = SPFarm.Local.Solutions;
foreach (SPSolution solution in solutions)
{
SPPersistedFile wspFile = solution.SolutionFile;
wspFile.SaveAs("c:\\wsp\\" + solution.Name);
}
Using Power Shell
$farm = Get-SPFarm
$file = $farm.Solutions.Item("custom.wsp").SolutionFile
$file.SaveAs("c:\temp\ custom.wsp")


0 comments:

Post a Comment

Popular Posts