Features are cheap! Features are good for you! Use features whenever you can!
As SharePoint developers, we hear this mantra all the time and of course, we create tons of features. This is a good thing, as it affords you control and functionality isolation.
In USP Journal Issue 8, I teach a method that relies heavy on using features. A lot. I’ve created solutions from this method where one ends up with hundreds of features just for the initial deployment. Most of these features are completely irrelevant for end users and thus should be hidden.
However, manually hiding hundreds of features take time. Well, at least it does to you or me, but a computer could hide them all within seconds, which I why I’ve written a small program to do just that.
The SPFeatureHider tool is very simple, but saves me a lot of time. Basically, it will iterate thorough a folder structure, find all feature.xml files, set the Hidden attribute to True and save the file.
A caveat is that the formatting of the feature.xml file is set to standard one-line per element format. There’s probably a way to work around this, but I can’t be bothered right now.
The syntax is simple. Just run
Where [path] is the root folder where you want to hide all features.
Because of this simple syntax, it’s also easy to add this program to your external tools. Follow the instructions in the SPSiteLister article and add Solution Directory as a parameter, as shown below.
Found this article valuable? Want to show your appreciation? Here are some options:
a) Click on the banners anywhere on the site to visit my blog's sponsors. They are all hand-picked and are selected based on providing great products and services to the SharePoint community.
b) Donate Bitcoins! I love Bitcoins, and you can donate if you'd like by clicking the button below.
c) Spread the word! Below, you should find links to sharing this article on your favorite social media sites. I'm an attention junkie, so sharing is caring in my book!