Installing or Uninstalling Features
Published: May 2010
You install features by deploying the feature files in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES\ directory, each feature has its own subdirectory. At the root of this folder, a Feature.xml file defines the contents of the feature. After the feature files are in the front-end web servers file system, you must install individual features before you can use them. To do this, run the following Windows PowerShell command using SharePoint Management Shell:
You can copy the files directly to the front-end web servers file system, however, it is recommended that you deploy feature files through a solution package, which requires farm administrator permissions.
For more information, see Installation and Deployment of a Farm Solution in SharePoint 2010.
In addition to installing a feature, you must activate it before you can use it (unless the feature is Farm scoped, which means it is activated automatically).
If you use the Current to retrieve a reference to the site, this will not work when provisioning from the command line. Check for a null value of the SPContext.Current object and, instead, use the SPFeatureReceiverProperties.Feature.Parent property and cast it to the appropriate SPSite or SPWeb object.
To activate a feature, run the following Windows PowerShell command using SharePoint Management Shell:
Enable-SPFeature FeatureFolderName -Url http://server/site/subsite
To uninstall a feature so that its definition is no longer available within a server farm, you can use the uninstall operation. After uninstalling a feature, reset Internet Information Services (IIS) so that changes can take effect.
You must deactivate features before uninstalling them unless they are WebApplication scoped or Farm scoped features.
To uninstall a Feature, run the following Windows PowerShell command using SharePoint Management Shell:
To deactivate a feature so that it becomes inactive at its originally assigned scope, you can use the Disable-SPFeature operation.
To deactivate a feature, run the following Windows PowerShell command using SharePoint Management Shell:
Disable-SPFeature FeatureFolderName -Url http://server/site/subsite