Search This Blog

Thursday, March 19, 2015

Download all solutions wsp from sharepoint 2010 central admin using powershell

[void][reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint")

[void][reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")
[void][reflection.assembly]::LoadWithPartialName("System")
[void][reflection.assembly]::LoadWithPartialName("System.Collections")
[Microsoft.SharePoint.Administration.SPFarm]$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()

Write-Host -foregroundcolor White "Starting solutions download process..."

foreach ($solution in $farm.Solutions)
{
Write-Host -foregroundcolor White ""
Write-Host -foregroundcolor Yellow "Downloading solution $solution..."
$file = $solution.SolutionFile
$solutionName = $solution.name
$file.SaveAs("c:\solutions\$solutionName")
Write-Host -foregroundcolor Green "Solution $solutionName downloaded successfully."
}

Write-Host Write-Host -foregroundcolor Green "All solutions downloaded in c:\solutions folder"
Read-Host 'Done...'

No comments:

Post a Comment