Created
February 9, 2017 13:34
-
-
Save trplll/b25071620b47e885f68ed79da7143927 to your computer and use it in GitHub Desktop.
Extract solutions from a SharePoint Farm into dir
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
$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