To export all your custom deployed WSP’s from Sharepoint to a physical folder.
To use this script. Create a folder in C: drive called Solutions and run this script as farm admin.
$dirName = “C:\Solutions”
foreach ($solution in Get-SPSolution)
$filename = $Solution.SolutionFile.Name
To run the PowerShell script simply create the folder c:\Solutions, or set another location in the script and run with Farm credentials or equivalent.