So the situation is we cannot find the solution files which was deployed long ago and the best, quick and easy way to get all WSP files from SharePoint is below script. The below script will copy all the deployed solution files to the folder specified.

Note: Create the folder before executing the command. And make sure the account running has proper permissions.

Start-Transcript "D:\wsp\transcript.txt"
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$solutions = [Microsoft.SharePoint.Administration.SPFarm]::Local.Solutions;
foreach ($solution in $solutions) {
   $solution.SolutionFile.SaveAs("D:\wsp\" + $solution.Name);
}
Stop-Transcript

By Indra

SharePoint Architect

Leave a Reply