Thursday, April 14, 2016

How to download a wsp file from Central Admin

You can easily download either one wsp file from central admin or you can download all wsp files by using powershell command in Sharepoint 2010 and 2013 environment.

============================
Download one wsp file
============================

$myFarm = Get-SPFarm
$myWSP = $myFarm.Solutions.Item("helloworld.wsp").SolutionFile
$myWSP.SaveAs("C:\helloworld.wsp")

============================
Download all wsp files
============================

$pathName = "c:\wspFiles\"

foreach ($solution in Get-SPSolution)
{
    $solid = $Solution.SolutionID
    $title = $Solution.Name
    $filename = $Solution.SolutionFile.Name
    $solution.SolutionFile.SaveAs("$pathName\$filename")
}

No comments:

Post a Comment