The following PowerShell Snippet exports all SharePoint Farm Solution Packages (.wsp) from the farm solution store. It does work on Windows 2003 R2 with PowerShell 1.0, which I find very practical because it is the standard configuration for WSS3 and MOSS 2007 installations.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$farm.Solutions | % {
$filename = ($pwd.ToString() + "\" + $_.SolutionFile.Name);
write-host ("Saving" + $filename);
$_.SolutionFile.SaveAs($filename)
}
From: MSDN