Thursday, May 14, 2015

PowerShell : Download WSP from Central Administration (SP2007)

Issue:

You require to move a site to testing server, but when you import the backup, it throw error with feature.

Solution:

Run this PowerShell script to download the solution.

[void][reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local();
$wsp = $farm.Solutions.Item("solutionname.wsp").SolutionFile;
$wsp.SaveAs("E:\somefolder\solutionname.wsp");