Extract WSP Solution files from SharePoint 2010 Farm

Before deploying updated WSP solution to SharePoint farm, administrators wish to take backup of current deployed solution in production servers just to stay on safe side. There is no option in CA to achieve this. Here is the script which gives us power to do.

(Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + "\" + $_.Name; $_.SolutionFile.SaveAs($var)}

To download single file use below script (Replace the YourSolutionFileName with actual WSP file name like abc.wsp):

$var = (Get-Location).Path + "\" + "YourSolutionFileName";(Get-SPFarm).Solutions["YourSolutionFileName"].SolutionFile.SaveAs($var)

$var = (Get-Location).Path + “\” + “YourSolutionFileName”; (Get-SPFarm).Solutions[“YourSolutionFileName”].SolutionFile.SaveAs($var)

%d bloggers like this: