Skip to main content

How to Create About_ Conceptual Help Files for Your Modules

First off, I want to thank Gaby Kaplan from Microsoft and the PowerShell team for helping find this path to success. 

I needed to find a very simplistic way of creating conceptual help files for my PowerShell modules.  Some of this code gets sent to my students after my PowerShell classes and I like to provide as much information as I can.  You will recognize conceptual help files because they start with About_.  So, here we go.

Step 1. Create a text file in the same directory as your script module.  Mt module is stored in my user account’s Documents\WindowsPowerShell\Modules\PSV3. PSv3 is the name of the module that I will be sending to my class.

Step 2. Name the file correctly. The syntax is About_NameOfYourConcept.help.txt.

Step 3. Add the content to the text file and save it.

Step 4. Import the module.  Whoa!!!! Wait a second. in PowerShell V3, we had auto loading of all of our modules.  That is true and this is what kind of messed me up a bit.  Thanks to Gaby’s time and patience, she was able to find the reason for this.  You will need to import the module manually. In PowerShell V4, you do not.  This is what the PowerShell Project Manager sent to Gaby:

Prior to PowerShell 4.0, the module must be imported into the current session in order for Get-Help to find the topic. This is because Get-Help only looks in $pshome and loaded module folders for About topics. We improved this in PowerShell 4.0 so that the module no longer needs to be imported / loaded. Get-Help will look in all module folders under PSModulePath for a matching About topic.

The PowerShell PM also noted that if you store your help file in the $PSHOME folder, it will be deleted during servicing.

So, in walks Hyper-V and some virtualization.  Utilizing a preview copy of Windows 8.1, I gave this a try.  Like I said, preview copy.  This capability is not there just yet, so I’m going to wait for the full release.

To see what else is new in V4, check out What’s New in PowerShell.

If you would like to give the Windows 8.1 preview a try (as well as PowerShell V4) follow this link to Microsoft.

Comments

Popular posts from this blog

Adding a Comment to a GPO with PowerShell

As I'm writing this article, I'm also writing a customization for a PowerShell course I'm teaching next week in Phoenix.  This customization deals with Group Policy and PowerShell.  For those of you who attend my classes may already know this, but I sit their and try to ask the questions to myself that others may ask as I present the material.  I finished up my customization a few hours ago and then I realized that I did not add in how to put a comment on a GPO.  This is a feature that many Group Policy Administrators may not be aware of. This past summer I attended a presentation at TechEd on Group Policy.  One organization in the crowd had over 5,000 Group Policies.  In an environment like that, the comment section can be priceless.  I always like to write in the comment section why I created the policy so I know its purpose next week after I've completed 50 other tasks and can't remember what I did 5 minutes ago. In the Group Policy module for PowerShell V3, th

Return duplicate values from a collection with PowerShell

If you have a collection of objects and you want to remove any duplicate items, it is fairly simple. # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   # Remove the duplicate values. $Set1 | Select-Object -Unique 1 2 3 4 5 6 7 What if you want only the duplicate values and nothing else? # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   #Create a second collection with duplicate values removed. $Set2 = $Set1 | Select-Object -Unique   # Return only the duplicate values. ( Compare-Object -ReferenceObject $Set2 -DifferenceObject $Set1 ) . InputObject | Select-Object – Unique 1 2 This works with objects as well as numbers.  The first command creates a collection with 2 duplicates of both 1 and 2.   The second command creates another collection with the duplicates filtered out.  The Compare-Object cmdlet will first find items that are diffe

How to list all the AD LDS instances on a server

AD LDS allows you to provide directory services to applications that are free of the confines of Active Directory.  To list all the AD LDS instances on a server, follow this procedure: Log into the server in question Open a command prompt. Type dsdbutil and press Enter Type List Instances and press Enter . You will receive a list of the instance name, both the LDAP and SSL port numbers, the location of the database, and its status.