Friday, August 27, 2010

SHAREPOINT 2010: ADDING AND INSTALLING SOLUTION (.WSP FILE) FROM POWERSHELL

In this section I am gonna walk you through the process of adding and installing .wsp solution using PowerShell. PowerShell is the new console, in fact it's not new it's was also the part of Windows Server 2003 however people use to use stsadm command via DOS console. But now in Windows Server 2008 Microsoft has launched it as a standard console for administrating Microsoft server products for instance: SQL Server, Exchange, and SharePoint. Following are the series of steps that we need to follow:

1- Open PowerShell.


2 - Run the following command in PowerShell in order to activate SharePoint specific commands.


 Add-PSSnapin Microsoft.SharePoint.PowerShell.


3 - Now to add wsp in the Solution Store, run this command in PowerShell.


 Add-SPSolution [Path of .wsp file].wsp


 Note: Solution Store can be open from Central Administration at following path:
 Adminstration--> System Settings--> Farm Management--> Manage farm solutions

4 - To install wsp solution following command will be used.


 Install-SPSolution –Identity [wsp name].wsp –WebApplication [url of web application] -GACDeployment


NOTE: Features in the wsp solution might not be available to the site collection, if this the case:


1 - Browse the site collection in which you deployed this solution.

2 - Navigate to Site Actions--> Site Settings--> Site Collection Administration--> Site collection features.

3 - Locate your solution and activate it by pressing 'Activate' button besides it.


Go and check your feature, it'll be there. Have a nice day :).

1 comment:

  1. Thanks for the useful steps, I cant see the solution in the site collection features but cant see the webpart in the gallery to populate it:
    Home >> Web Part Gallery: New Web Parts

    Thanks,
    Namir

    ReplyDelete