Share via


SharePoint 2010 Solution and Feature Deployment

In SharePoint 2010 PowerShell should be used to deploy solutions and enable features. There are a number of cmdlets used in this process.

PowerShell Cmdlets

To add a solution to SharePoint previously used:

  • ·         Stsadm –o addsolution

In PowerShell you should now use:

 

Once the solution is added to SharePoint you will need to install the solution for the webapplication[s] where you would like to use. Previously the command used was:

  • ·         Stsadm –o Deploysolution

In PowerShell you should now use:

 

Once the Solution has been deployed you then need to enable the features that the solution installed. Previously the command used was:

  • ·         Stsadm –o Activatefeature

In PowerShell you should now use:

Resources

These cmdlets should allow you to deploy and enable features. There are many more commands for creating feature packs, removing freatures and solutions. They can be found here: https://technet.microsoft.com/en-us/library/ee906565.aspx

 

Stsadm command to PowerShell cmdlets mapping information can be found here: https://technet.microsoft.com/en-us/library/ff621084.aspx

 

I’ve borrowed and made a simple modification to a script from the Technet Script Center that automates this process. As with any script I cannot guarantee that this script will have the results you expect in your environment. Standard disclaimers apply…

 

The one modification I would make to this script starts at line 112. Below I’ve added a looping structure that should allow you to enable more than one feature.

 

 

$featureList = Get-SPFeature | where {$_.SolutionID -eq $solution.ID}

foreach ($feature in $featureList) {

    Write-Host "Going to enable Feature {0}" -f $feature.DisplayName

    Enable-spfeature -identity $feature.DisplayName -url $url -confirm:$false

    Write-Host -ForegroundColor Green 'Feature enabled'

}

 

This should get you started with using PowerShell to administer your SharePoint farm[s]

 

/ip