Here is a handy script that will export all farm solution .wsp and .cab files at once:
[sourcecode language=”powershell”]
Add-PSSnapin Microsoft.SharePoint.PowerShell
$farm = Get-SPFarm
$farm.Solutions | ForEach-Object{$_.SolutionFile.SaveAs(“c:\export\” + $_.SolutionFile.name)}
Once you have moved the solutions to another machine, you can use the following script to add the solutions to the new farm:
Add-PSSnapin Microsoft.SharePoint.PowerShell
$files = Get-ChildItem “c:\install\”
ForEach ($file in $files) {Add-SPSolution $file.FullName}
[/sourcecode]
The post Using Powershell to export & import farm solutions appeared first on Messor Solutions, LLC..