Do-It-Yourself SharePoint Tools – SPFeatureHider

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.

If you’ve read my previous posts regarding SharePoint tools, you’ll see that this tool falls nicely into the ‘create a tool when you need it’ philosophy, just like the SPSiteLister tool.

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

c:\>SPFeatureHider.exe [path]

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.

17.03

The whole solution is available for download here (20 kb RAR) or here (20 Kb zip).

.b

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.
Donate Bitcoins

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!

Pin It

Tags: ,

Post Author

This post was written by who has written 413 posts on Furuknap's SharePoint Corner.

I do SharePoint. When I'm not doing SharePoint, I sleep, and then I dream about SharePoint. Oh, and I dabble a bit in cryptocurrencies (Bitcoin, Litecoin, etc)

No comments yet.

Leave a Reply