How to: Create a OneNote help file out of a PowerShell Module

How to: Create a OneNote help file out of a PowerShell Module

Being an ITPro in the current day and age I write a decent amount of PowerShell. Since I am not always on a server that has the SharePoint PowerShell modules installed most of my time on TechNet is spent basically reading the help files of specific modules to validate syntax, flags or review examples. This can become a bit of a pain after a while so I thought it would be nice to have a OneNote notebook on my SkyDrive that I could sync to my laptops or access in the cloud where I could search more easily and have all of my cmdlets at my fingertips.

Here is how I accomplished this:

Select the module. For this example I used the Microsoft.SharePoint.PowerShell module, however this will work with any PowerShell module.

Run the following command to get an output of the cmdlets in the module:

1

Opening in Excel will give you the best opportunity to grab what you need. Column K in this particular output will list all of the cmdlets names.

2 

Grab just that column and copy it to a text file called “cmdlets.csv”.

Next use the following PowerShell command to create an ANSI output file for each of the help files in the module.

3

For this module it created 771 individual text files. Using the OneNote 2010 Text Importer from John Guin I was able to create a single OneNote file that contains all of the help for the entire SharePoint 2013 PowerShell module that is now searchable in a faster and easier way. One caveat, I had to use OneNote 2010 for the importer to work properly.

Not sure if this will be helpful for anyone else, but I use it all the time when writing PowerShell Code.

4

I will endeavor to keep this up to date, but since I just explained how to accomplish this, if I slip up you can perform the actions yourself.

You can get download the notebook here: http://sdrv.ms/X7PqqI

notepad  get cmdlets in the module script

notepad  create ANSI output file for each of the help files in the module script

Comments are closed.