[Go to] SharePoint 2010 powershell feature cmdlets

Source: Internet
Author: User

In this installment its time to look at the various cmdlets that have to do with features. of course you can look at the UI to do this but its much, much easier to do this powershell and dare I say more fun.

Now keep in mind that this only relatedFarm Level features, I will cover sandbox solutions and features next!

Listing features on farm, site collection and site

The main cmdlet used within powershell to list features isGet-spfeatureCmdlets. To show all the features onFarmListed by display name and sorted use this:

1 Get-SPFeature | Sort -Property DisplayName

To show all the features onFarmGrouped by scope in a table use:

1 Get-SPFeature | Sort -Property DisplayName, Scope | FT -GroupBy Scope DisplayName

To see all features forWeb Application:

1 Get-SPFeature -WebApplication http://webapplication

To see all features forSite collection:

1 Get-SPFeature -Site http://sitecollection

To see all features forSite:

1 Get-SPFeature -Web http://siteurl

Remember for some more information relating to the features you can use:

1 Get-SPFeature -Web http://siteurl | Format-List

To see all the members that a feature definition has use:

1 Get-SPFeature -Web http://siteurl | Get-Member

Enabling and disabling features

To disable and enable features is all pretty easy once again usingDisable-spfeatureAndEnable-spfeatureCmdlets but there is a trick. You need the name of the feature folder that contains the actual feature not what is displayed in the UI so be careful:

1 Enable-SPFeature -Identity "Hold" -URL http://url

You can apply this to any site and site collection scoped features.
Obviusly to disable a feature just use the same syntax but with the disable-feature cmdlet

1 Disable-SPFeature -Identity "Hold" -URL http://url

Remember though that-IdentityIsDisplaynameProperty of the feature, not the text displayed on the UI which is actually retrieved from a Resources file.
For example the document sets feature looks like below in the SharePoint interface:
But to actually enable it you have to use the following cmdlet:

1 Enable-SPFeature -Identity DocumentSet -URL http://url
Installing and uninstalling featuresonce again this is pretty straight forward and is really made up of only two cmdlets: Install-spfeatureAnd Uninstall-spfeatureTo install a feature you need to specify the name of the folder that your feature contains:
1 Install-SPFeature "FeatureFolderName"

To uninstall simply use the sameUninstall-featureCommand with the same parameters:

1 UnInstall-SPFeature "FeatureFolderName"
[Original article address: http://www.sharepointanalysthq.com/2010/09/sharepoint-2010-powershell-feature-cmdlets-2 /]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.