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


Posted on 16/02/2017, in Administration, Migration, PowerShell, SharePoint and tagged , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: