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

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.

How to run GPResult on a remote client with PowerShell

In the past, to run the GPResult command, you would need to either physically visit this client, have the user do it, or use and RDP connection.  In all cases, this will disrupt the user.  First, you need PowerShell remoting enabled on the target machine.  You can do this via Group Policy . Open PowerShell and type this command. Invoke-Command –ScriptBlock {GPResult /r} –ComputerName <ComputerName> Replace <ComputerName> with the name of the target.  Remember, the target needs to be online and accessible to you.

Error icon when creating a GPO Preference drive map

You may not have an error at all.  Take a look at the drive mapping below. The red triangle is what threw us off.  It is not an error.  It is simply a color representation of the Replace option of the Action field in the properties of the drive mappings. Create action This give you a green triangle. The Create action creates a new mapped drive for users. Replace Action The Replace action gives you a red triangle.  This action will delete and recreate mapped drives for users. The net result of the Replace action is to overwrite all existing settings associated with the mapped drive. If the drive mapping does not exist, then the Replace action creates a new drive mapping. Update Action The Update action will have a yellow triangle. Update will modify settings of an existing mapped drive for users. This action differs from Replace in that it only updates settings defined within the preference item. All other settings remain as configured on the mapped drive. If the