PowerShell logo

Quickest way to download all the wsp-packages in a SharePoint farm

Sometimes – pretty often in the good old on-premises world, actually – you’ll need to have a copy of all the packages that are deployed to a certain farm.

So – how to download all of the deployed farm solutions (essentially, cabinet files renamed to .wsp) from a farm? Luckily, it’s quite easy!

Solution

To download all deployed farm solutions (wsp-packages) from a SharePoint farm is pretty simple using PowerShell. No need to download individual packages through cumbersome interfaces! You don’t even have to open the Central Administration! 🙂 

The following script, when run in PowerShell, will download all of the deployed farm solutions to the specified $FolderPath. You’ll need to run the Powershell window as a farm admin, though!

$FolderPath = "c:\backup\wsp"  
foreach ($solution in Get-SPSolution)  
{  
   $id = $Solution.SolutionID  
   $title = $Solution.Name  
   $filename = $Solution.SolutionFile.Name  
   $solution.SolutionFile.SaveAs("$FolderPath\$filename")  
}

Originally got this one from the cool guys at C-Sharp Corner.

The following two tabs change content below.

Antti K. Koskela

Solutions Architect / Escalations Engineer at Koskila / Norppandalotti Software / Valo Solutions
Antti Koskela is a proud digital native nomadic millenial full stack developer (is that enough funny buzzwords? That's definitely enough funny buzzwords!), who works as a Solutions Architect for Valo Intranet, the product that will make you fall in love with your intranet. Working with the global partner network, he's responsible for the success of Valo deployments happening all around the world. He's been a developer from 2004 (starting with PHP and Java), and he's been bending and twisting SharePoint into different shapes since MOSS. Nowadays he's not only working on SharePoint, but also on .NET projects, Azure, Office 365 and a lot of other stuff. This is his personal professional (e.g. professional, but definitely personal) blog.

Let me know your thoughts!