Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trplll/b25071620b47e885f68ed79da7143927 to your computer and use it in GitHub Desktop.
Save trplll/b25071620b47e885f68ed79da7143927 to your computer and use it in GitHub Desktop.
Extract solutions from a SharePoint Farm into dir
$dirName = "<directory path>"
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 {
$solution.SolutionFile.SaveAs("$dirName\$filename")
Write-Host " – done" -foreground green
}
catch
{
Write-Host " – error : $_" -foreground red
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment