Created
June 10, 2020 04:11
-
-
Save hansgafriedzal/0666564f37a2550e0f030fcbbfd91d7c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function Export-All-XSPSolution ($Location) | |
{ | |
$farm = Get-SPFarm | |
If (test-path $Location) {} Else {mkdir $Location} | |
Write-Host "Downloading..." | |
$farm.Solutions | |
foreach($solution in $farm.Solutions){ | |
$solution = $farm.Solutions[$solution.Name] | |
$file = $solution.SolutionFile | |
$file.SaveAs($Location + ‘\’ + $solution.Name) | |
} | |
Write-Host "All the solutions are downloaded to $Location" | |
} | |
$timestamp = Get-Date -format "yyyyMMddHHmmss" | |
$path = "D:\BackupWsp\$timestamp" | |
Export-All-XSPSolution -Location $path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment