Powershell: Retrieve a WSP from SharePoint Solution Store
by Eli Van Eenwyk, posted June 21, 2010
I’m not saying this has ever happened to me but sometimes your custom application isn’t behaving as expecting and you begin to wonder whether or not your latest deployment contains the right WSP. Problem is…you don’t remember which WSP you ran STSADM against. So, I figured, lets see what file is in actually in the SharePoint solution store. Below is a Powershell script that save the file locally where you can crack it open or maybe even deploy it back to TEST :) Yes, you can admit it, it has happened to you!
1: $solutioname = "inergex.mycustomapplication.wsp"
2: 3: [reflection.assembly]::Loadwithpartialname("microsoft.sharepoint")
4:
5: $farm = [Microsoft.sharepoint.administration.spfarm]::Local
6:
7: $solution = $farm.Solutions[$solutioname]
8: $file = $solution.SolutionFile
9:
10: $file.SaveAs("c:\" + $solutioname)
SharePoint Rocks!
Eli
Post new comment