Extract a WSP Solution from SharePoint 2010

Tags: SharePoint 2010, Farm Solution

$farm = Get-SpFarm
$file = $farm.Solutions.Item("FileName.wsp").SolutionFile
$file.SaveAs("c:\FileName.wsp")