Blog Archives

SharePoint – Export all solutions wsp using PowerShell script

Hey Everyone,

Today i will post a script very helpful when you are on Migration steps and you need export all wsp solutions.


$dirName = "C:WSP"
if (!(Test-Path -path $dirName))
New-Item $dirName -type directory
Write-Host Exporting solutions to $dirName
foreach ($solution in Get-SPSolution)
    $id = $Solution.SolutionID
    $title = $Solution.Name
    $filename = $Solution.SolutionFile.Name
    Write-Host "Exporting ‘$title’ to …$filename" -nonewline
    try {
        Write-Host " – done" -foreground green
        Write-Host " – error : $_" -foreground red


Fábio Carvalho
SharePoint Consultant