Last active
August 29, 2015 14:18
-
-
Save Na0mir/c368937047be16b01c31 to your computer and use it in GitHub Desktop.
Download all SharePoint wsp solutions from SharePoint farm.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 10.04.2013 | |
# Description: Download all SharePoint wsp solutions from SharePoint farm. | |
# ---------------------------------------------- | |
# -- Initialize -- # | |
Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue | |
# -- Options -- # | |
$dirName = "C:\ExportedSolutions" | |
# -- Script -- # | |
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