Deploy SharePoint 2010 Web Parts Using windows PowerShell

Related Posts :
Windows Powershell Interview questions SharePoint 2010

Deploy sharepoint 2007 web parts in sharepoint 2010

Steps To open up the PoweShell:

On the Start menu, click All Programs.

Click Microsoft SharePoint 2010 Products.

Click SharePoint 2010 Management Shell.

At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press ENTER:

Note : You are a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed.

Deploy\Install WebPart

Install-SPWebPartPack -LiteralPath "FullPathforCabfile" -Name "WebPartName"

FullPathforCabfile - is the full path to the CAB file that is being deployed.

WebPartName - is the name of the Web Part that is being deployed.

Install Activate and Deactivate Feature using Windows Powershell

Install Feature :

$MyFeatureId = $(Get -SPFeature -limit all where {$_.displayname -eq "myfeatureName"}).Id

Install -SPFeature $MyFeatureId

Activate\Enable Feature :

$singleSiteCollection = Get -SPSite -Identity http://MySingleSiteCollectionURL

Enable -SPFeature $MyFeatureId -Url $singleSiteCollection.URL

Deactivate\Disable Feature :

$singleSiteCollection = Get-SPSite -Identity http://MySingleSiteCollectionURL

Disable -SPFeature $MyFeatureId -Url $singleSiteCollection.URL

Related Posts :

Common SharePoint PowerShell Commands

PowerShell 2010 For SharePoint - Resources


  1. SharePoint 2010 Blogs -
    MOSS 2007-
    Personal Blogs -
    Interview Questions -
    Asp.Net -



This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at .

Copyright (c) 2010 @ All rights are reserved.Do Not Copy.

@ Learning