0 out of 4 rated this helpful - Rate this topic

Creating the Cmdlet Help File

This section describes how to create a valid XML file for a Microsoft® Windows® PowerShell cmdlet Help topic. This section discusses how to name the Help file, how to add the appropriate XML headers, and how to add nodes that will contain the different sections of the cmdlet Help content.

NoteNote:

For a complete view of a Help file, open one of the dll-Help.xml files located in the Microsoft® Windows® PowerShell installation directory. For example, the Microsoft.PowerShell.Commands.Management.dll-Help.xml file contains content for several of the Windows PowerShell cmdlets.

Topics in this section include:

Name the Help File

Create a text file and save it. The file name must have the following format so that Microsoft® Windows® PowerShell can detect it as a cmdlet Help file.

<PSSnapInAssemblyName>.dll-Help.xml

Add an XML Header

Add the following XML headers to the text file. Be aware that the file will be validated against the Multi-Agent Modeling Language (MAML) schema. Currently, Microsoft® Windows® PowerShell does not provide any tools to validate the file.

<?xml version="1.0" encoding="utf-8" ?>
<helpItems xmlns="http://msh" schema="maml">

Add a Command Node

Add a <command:command> node to the cmdlet Help file for each cmdlet in the assembly. Each node within the <command:command> node relates to different sections of the cmdlet Help topic. The following table lists brief descriptions of each node, followed by the XML used to define these nodes.

Node Description

<details>

This node is used to add content for the NAME and SYNOPSIS sections of the cmdlet Help topic. For more information, see Adding the Cmdlet Name and Synopsis to a Cmdlet Help Topic.

<maml:description>

This node is used to add content for the DETAILED DESCRIPTION section of the cmdlet Help topic. For more information, see Adding the Detailed Description to a Cmdlet Help Topic.

<command:syntax>

This node is used to add content for the SYNTAX section of the cmdlet Help topic. For more information, see Adding Syntax to a Cmdlet Help Topic.

<command:parameters

This node is used to add content for the PARAMETERS section of the cmdlet Help topic. For more information, see Adding Parameters to a Cmdlet Help Topic.

<command:inputTypes

This node is used to add content for the INPUT TYPE section of the cmdlet Help topic. For more information, see Adding Input Types to a Cmdlet Help Topic.

<command:returnValues

This node is used to add content for the RETURN TYPE section of the cmdlet Help topic. For more information, see Adding Return Values to a Cmdlet Help Topic.

<maml:alertset>

This node is used to add content for the RETURN TYPE section of the cmdlet Help topic. For more information, see Adding Notes to a Cmdlet Help Topic.

<command:examples>

This node is used to add content for the EXAMPLES section of the cmdlet Help topic. For more information, see Adding Examples to a Cmdlet Help Topic.

<maml:relatedLinks

This node is used to add content for the RELATED LINKS section of the cmdlet Help topic. For more information, see Adding Related Links to a Cmdlet Help Topic.

<command:command
  xmlns:maml=http://schemas.microsoft.com/maml/2004/10
  xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004
  /10" 
  xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
  <comand:details>
    <!--Add name an synopsis here-->
  </comand:details>
  <maml:description>
    <!--Add detailed description here-->
  </maml:description>
  <command:syntax>
    <!--Add syntax information here-->
  </command:syntax>
  <command:parameters>
    <!--Add parameter information here-->
  </command:parameters>
  <command:inputTypes>
    <!--Add input type information here-->
  </command:inputType>
  <command:returnValues>
    <!--Add return value information here-->
  </command:inputValues>
  <maml:alertSet>
    <!--Add Note information here-->
  </maml:alertSet>
  <command:examples>
    <!--Add cmdlet examples here-->
  </command:inputValues>
  <maml:relatedLinks>
    <!--Add links to related content here-->
  </maml:relatedLinks>
</command:command>

See Also

Footer image

Send comments about this topic to Microsoft.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.