How can I use a command line to manage SharePoint Feature?
Generally, IT administrators prefer to use command lines to maintain Feature in SharePoint Farm, saving them the trouble of logging on to a specific site. For example, if IT needs to enable the Site Collection Feature when receiving an end user request, log on to site collection> Site Setting to find the Feature and click enable \ disable, if you use the command line to directly enter commands and the website will be faster.
Let's take SharePoint2013 as an example to see how to execute Feature's enable, disable, get, install, and uninstall commands:
Install FeatureLog on to the SharePoint Server and copy the built Feature to the SharePoint installation directory "... \ Program Files \ Common Files \ microsoft shared \ Web Server Extensions \ 15 \ TEMPLATE \ FEATURES ";
Limit n s t a I-SPFeature-path Cus t 0 Fe at 'isplaynam Cus t 0 Feature r664dd76 a 3 5 e f a 4g14-be64 Compat I bilityL e-c a852879 ddI 4 ">
- Log on to a site collection, Site Settings-> Site Features, and you can see the install Feature. The default status is disable.Enable FeatureOpen SharePoint2013 Management Shell in Administrator mode, enter the command and execute it;
Enable-SPFeature-identity "Feature Name"-URL "Site Collection URL"
Log on to Site Collection and view the Feature in Site Settings. The Feature is enabled successfully.Disable FeatureRun SharePoint2013 Management Shell in Administrator mode, enter the command and run it, and enter "Y" for execution in the pop-up confirmation dialog box;Disable-SPFeature-identity "FeatureName"-URL "Site CollectionURL"
Log on to Site Collection and view the Feature in Site Settings. The Feature is disabled successfully.Get FeatureRun SharePoint2013 Management Shell in Administrator mode, enter the command, and execute the command to query all the Feature values under the current site.Get-SPSite "SiteCollection URL" | Get-SPWeb-Limit ALL | % {Get-SPFeature-Web $ _} | Select DisplayName, ID-Unique
Enter the following command in SharePoint2013 Management Shell to know which Feature is deployed to the Site.Get-SPFeature-Limit ALL | Where-Object {$ _. Scope-eq "SITE "}
Uninstall FeatureOpen the cmdpoint2013 Management Shell in Administrator mode and enter the command line. In the displayed confirmation prompt, enter "Y" and run the command;Uninstall-SPFeature-identity "Feature Folder Name"-force
U n in s t a I-f 0 e 0 n f-SPFeature-identity Cus t 0 Feature Help [? ] 0 u S 0 u t 0 t h is t n? Erforming t he operation n in S t a I I-S PFe at "0 =" "n =" "target =" "fe =" "at =" "ure =" "de = "" f = "" in = "" it = "" io = "" 15 = "" 6 = "" 64dd76 = "" 1 = "" 3 = "" 5 = "" e = "" 4g14-be = "" 64-c = "" a852879 = "" ddi = "" 4 = "=" "[=" "y ="] = "" s = "" r = "" t = "" I = "" no = "" 11 = "" suspend = "" (= "" au = "" is = "" '= "", = "") = "": = "" c = "" xu = "" rs = "" xadm = "" rat = "", = "". = "" demo = ""> ">
Log on to the SharePoint website and check the Feature status. It has been uninstalled successfully.
These are the commands for running Install, Uninstall, Enable, Disable, and Get on Feature in SharePoint. Thank you for reading!