Comment-Based Help Keywords

 

This topic lists and describes the keywords in comment-based help.

The following are valid comment-based Help keywords. They are listed in the order in which they typically appear in a Help topic along with their intended use. These keywords can appear in any order in the comment-based Help, and they are not case-sensitive.

Note that the .ExternalHelp keyword takes precedence over all other comment-based help keywords. When .ExternalHelp is present, the T:Microsoft.PowerShell.Commands.Get-Help cmdlet does not display comment-based help, even when it cannot find a help file that matches the value of the keyword.

.Synopsis

A brief description of the function or script. This keyword can be used only once in each topic.

.Description

A detailed description of the function or script. This keyword can be used only once in each topic.

.Parameter<Parameter-Name>

The description of a parameter. You can include a .Parameter keyword for each parameter in the function or script.

The .Parameter keywords can appear in any order in the comment block, but the order in which the parameters appear in the Param statement or function declaration determines the order in which the parameters appear in Help topic. To change the order of parameters in the Help topic, change the order of the parameters in the Param statement or function declaration.

You can also specify a parameter description by placing a comment in the Param statement immediately before the parameter variable name. If you use both a Param statement comment and a .Parameter keyword, the description associated with the .Parameter keyword is used, and the Param statement comment is ignored.

.Example

A sample command that uses the function or script, optionally followed by sample output and a description. Repeat this keyword for each example.

.Inputs

The Microsoft .NET Framework types of objects that can be piped to the function or script. You can also include a description of the input objects.

.Outputs

The .NET Framework type of the objects that the cmdlet returns. You can also include a description of the returned objects.

.Notes

Additional information about the function or script.

.Link

The name of a related topic. Repeat this keyword for each related topic. This content appears in the Related Links section of the Help topic.

The .Link keyword content can also include a Uniform Resource Identifier (URI) to an online version of the same Help topic. The online version opens when you use the Online parameter of Get-Help. The URI must begin with "http" or "https".

.Component

The technology or feature that the function or script uses, or to which it is related. This content appears when the Get-Help command includes the Component parameter of Get-Help.

.Role

The user role for the Help topic. This content appears when the Get-Help command includes the Role parameter of Get-Help.

.Functionality

The intended use of the function. This content appears when the Get-Help command includes the Functionality parameter of Get-Help.

.ForwardHelpTargetName <Command-Name>

Redirects to the Help topic for the specified command. You can redirect users to any Help topic, including Help topics for a function, script, cmdlet, or provider.

.ForwardHelpCategory <Category>

Specifies the Help category of the item in ForwardHelpTargetName. Valid values are Alias, Cmdlet, HelpFile, Function, Provider, General, FAQ, Glossary, ScriptCommand, ExternalScript, Filter, or All. Use this keyword to avoid conflicts when there are commands with the same name.

.RemoteHelpRunspace <PSSession-variable>

Specifies a session that contains the Help topic. Enter a variable that contains a PSSession. This keyword is used by the Export-PSSession cmdlet to find the Help topics for the exported commands.

.ExternalHelp <XML Help File>

Specifies the path and/or name of an XML-based Help file for the script or function.

The .ExternalHelp keyword tells the T:Microsoft.PowerShell.Commands.Get-Help cmdlet to get help for the script or function in an XML-based file. The .ExternalHelp keyword is required when using an XML-based help file for a script or function. Without it, Get-Help will not find a help file for the function or script.

The .ExternalHelp keyword takes precedence over all other comment-based help keywords. When .ExternalHelp is present, the T:Microsoft.PowerShell.Commands.Get-Help cmdlet does not display comment-based help, even when it cannot find a help file that matches the value of the keyword.

When the function is exported by a script module, the value of .ExternalHelp should be a file name without a path. Get-Help looks for the file in a locale-specific subdirectory of the module directory. There are no requirements for the file name, but a best practice is to use the following file name format: <ScriptModule>.psm1-help.xml.

When the function is not associated with a module, include a path and file name in the value of the .ExternalHelp keyword. If the specified path to the XML file contains UI-culture-specific subdirectories, Get-Help searches the subdirectories recursively for an XML file with the name of the script or function in accordance with the language fallback standards established for Windows, just as it does for all XML-based Help topics.

For more information about the cmdlet Help XML-based Help file format, see Writing Windows PowerShell Cmdlet Help.

Show: