Wednesday, July 9, 2014

How to get wsp to your local box from the farm solution in Sharepoint?

When i started to work on Sharepoint,i came across an requirement stating to work on the wsp features which is placed in farm solution.As it is tedious job to look on each and every features in Central Administration,i thought of downloading the wsp onto my local box than i googled a lot to get below command which retrieves the particular wsp you need to your local box as follows:

Syntax:

$farm = Get-SPFarm
$file = $farm.Solutions.Item(f1).SolutionFile
$file.SaveAs(f2)


Note:
f1 - describes the name of the wsp.
f2 - which path the wsp should be saved in local box.



Example:
$farm = Get-SPFarm
$file = $farm.Solutions.Item(“metalogix.wsp”).SolutionFile
$file.SaveAs(“c:\WSP\metalogix.wsp”)