1
1
---
2
2
description : Comment-Based Help Keywords
3
- ms.date : 05/21 /2025
3
+ ms.date : 09/22 /2025
4
4
no-loc : [FAQ, Function, General, Glossary, Provider, Component, Functionality, Role]
5
5
title : Comment-Based Help Keywords
6
6
---
@@ -20,105 +20,96 @@ when it can't find a help file that matches the value of the keyword.
20
20
21
21
## ` .SYNOPSIS `
22
22
23
- A brief description of the function or script. This keyword can be used only
24
- once in each topic.
23
+ A brief description of the function or script. This keyword can be used only once in each topic.
25
24
26
25
## ` .DESCRIPTION `
27
26
28
- A detailed description of the function or script. This keyword can be used only
29
- once in each topic.
27
+ A detailed description of the function or script. This keyword can be used only once in each topic.
30
28
31
29
## ` .PARAMETER <Parameter-Name> `
32
30
33
- The description of a parameter. You can include a ` .PARAMETER ` keyword for each
34
- parameter in the function or script.
31
+ The description of a parameter. You can include a ` .PARAMETER ` keyword for each parameter in the
32
+ function or script.
35
33
36
- The ` .PARAMETER ` keywords can appear in any order in the comment block, but the
37
- order in which the parameters appear in the ` param ` statement or function
38
- declaration determines the order in which the parameters appear in Help topic.
39
- To change the order of parameters in the Help topic, change the order of the
40
- parameters in the ` param ` statement or function declaration.
34
+ The ` .PARAMETER ` keywords can appear in any order in the comment block, but the order in which the
35
+ parameters appear in the ` param ` statement or function declaration determines the order in which the
36
+ parameters appear in Help topic. To change the order of parameters in the Help topic, change the
37
+ order of the parameters in the ` param ` statement or function declaration.
41
38
42
- You can also specify a parameter description by placing a comment in the
43
- ` param ` statement immediately before the parameter variable name. If you use
44
- both a ` param ` statement comment and a ` .PARAMETER ` keyword, the description
45
- associated with the ` .PARAMETER ` keyword is used, and the ` param ` statement
46
- comment is ignored.
39
+ You can also specify a parameter description by placing a comment in the ` param ` statement
40
+ immediately before the parameter variable name. If you use both a ` param ` statement comment and a
41
+ ` .PARAMETER ` keyword, the description associated with the ` .PARAMETER ` keyword is used, and the
42
+ ` param ` statement comment is ignored.
47
43
48
44
## ` .EXAMPLE `
49
45
50
- A sample command that uses the function or script, optionally followed by
51
- sample output and a description. Repeat this keyword for each example.
46
+ A sample command that uses the function or script, optionally followed by sample output and a
47
+ description. Repeat this keyword for each example.
52
48
53
49
## ` .INPUTS `
54
50
55
- The .NET types of objects that can be piped to the function or script. You can
56
- also include a description of the input objects. Repeat this keyword for each
57
- input type.
51
+ The .NET types of objects that can be piped to the function or script. You can also include a
52
+ description of the input objects. Repeat this keyword for each input type.
58
53
59
54
## ` .OUTPUTS `
60
55
61
- The .NET type of the objects that the cmdlet returns. You can also include a
62
- description of the returned objects. Repeat this keyword for each output type.
56
+ The .NET type of the objects that the cmdlet returns. You can also include a description of the
57
+ returned objects. Repeat this keyword for each output type.
63
58
64
59
## ` .NOTES `
65
60
66
61
Additional information about the function or script.
67
62
68
63
## ` .LINK `
69
64
70
- The name of a related topic. Repeat this keyword for each related topic. This
71
- content appears in the Related Links section of the Help topic.
65
+ The name of a related topic. Repeat this keyword for each related topic. This content appears in the
66
+ Related Links section of the Help topic.
72
67
73
- The ` .LINK ` keyword content can also include a Uniform Resource Identifier
74
- (URI) to an online version of the same help topic. The online version opens
75
- when you use the ** Online** parameter of ` Get-Help ` . The URI must begin with
76
- ` http ` or ` https ` .
68
+ The ` .LINK ` keyword content can also include a Uniform Resource Identifier (URI) to an online
69
+ version of the same help topic. The online version opens when you use the ** Online** parameter of
70
+ ` Get-Help ` . The URI must begin with ` http ` or ` https ` .
77
71
78
72
## ` .COMPONENT `
79
73
80
- The name of the technology or feature that the function or script uses, or to
81
- which it's related. The ** Component** parameter of ` Get-Help ` uses this value
82
- to filter the search results returned by ` Get-Help ` .
74
+ The name of the technology or feature that the function or script uses, or to which it's related.
75
+ The ** Component** parameter of ` Get-Help ` uses this value to filter the search results returned by
76
+ ` Get-Help ` .
83
77
84
78
## ` .ROLE `
85
79
86
- The name of the user role for the help topic. The ** Role** parameter of
87
- ` Get-Help ` uses this value to filter the search results returned by ` Get-Help ` .
80
+ The name of the user role for the help topic. The ** Role** parameter of ` Get-Help ` uses this value
81
+ to filter the search results returned by ` Get-Help ` .
88
82
89
83
## ` .FUNCTIONALITY `
90
84
91
- The keywords that describe the intended use of the function. The
92
- ** Functionality** parameter of ` Get-Help ` uses this value to filter the search
93
- results returned by ` Get-Help ` .
85
+ The keywords that describe the intended use of the function. The ** Functionality** parameter of
86
+ ` Get-Help ` uses this value to filter the search results returned by ` Get-Help ` .
94
87
95
88
## ` .FORWARDHELPTARGETNAME <Command-Name> `
96
89
97
- Redirects to the help topic for the specified command. You can redirect users
98
- to any help topic, including help content for a function, script, cmdlet, or
99
- provider.
90
+ Redirects to the help topic for the specified command. You can redirect users to any help topic,
91
+ including help content for a function, script, cmdlet, or provider.
100
92
101
93
``` powershell
102
94
# .FORWARDHELPTARGETNAME <Command-Name>
103
95
```
104
96
105
97
## ` .FORWARDHELPCATEGORY `
106
98
107
- Specifies the help category of the item in ` .FORWARDHELPTARGETNAME ` . Valid
108
- values are ` Alias ` , ` Cmdlet ` , ` HelpFile ` , ` Function ` , ` Provider ` , ` General ` ,
109
- ` FAQ ` , ` Glossary ` , ` ScriptCommand ` , ` ExternalScript ` , ` Filter ` , or ` All ` . Use
110
- this keyword to avoid conflicts when there are commands with the same name.
99
+ Specifies the help category of the item in ` .FORWARDHELPTARGETNAME ` . Valid values are ` Alias ` ,
100
+ ` Cmdlet ` , ` HelpFile ` , ` Function ` , ` Provider ` , ` General ` , ` FAQ ` , ` Glossary ` , ` ScriptCommand ` ,
101
+ ` ExternalScript ` , ` Filter ` , or ` All ` . Use this keyword to avoid conflicts when there are commands
102
+ with the same name.
111
103
112
104
``` powershell
113
105
# .FORWARDHELPCATEGORY <Category>
114
106
```
115
107
116
108
## ` .REMOTEHELPRUNSPACE <PSSession-variable> `
117
109
118
- Specifies a session that contains the help topic. Enter a variable that
119
- contains a ** PSSession** object. This keyword is used by the
120
- [ Export-PSSession] [ 09 ] cmdlet to find the help content for the exported
121
- commands.
110
+ Specifies a session that contains the help topic. Enter a variable that contains a ** PSSession**
111
+ object. This keyword is used by the [ Export-PSSession] [ 09 ] cmdlet to find the help content for the
112
+ exported commands.
122
113
123
114
``` powershell
124
115
# .REMOTEHELPRUNSPACE <PSSession-variable>
@@ -132,31 +123,26 @@ Specifies an XML-based help file for the script or function.
132
123
# .EXTERNALHELP <XML Help File>
133
124
```
134
125
135
- The ` .EXTERNALHELP ` keyword is required when a function or script is documented
136
- in XML files. Without this keyword, ` Get-Help ` can't find the XML-based help
137
- file for the function or script.
138
-
139
- The ` .EXTERNALHELP ` keyword takes precedence over other comment-based help
140
- keywords. If ` .EXTERNALHELP ` is present, ` Get-Help ` doesn't display
141
- comment-based help, even if it can't find a help topic that matches the value
142
- of the ` .EXTERNALHELP ` keyword.
143
-
144
- If the function is exported by a module, set the value of the ` .EXTERNALHELP `
145
- keyword to a filename without a path. ` Get-Help ` looks for the specified file
146
- name in a language-specific subdirectory of the module directory. There are no
147
- requirements for the name of the XML-based help file for a function, but a best
148
- practice is to use the following format:
149
-
150
- ``` Syntax
151
- <ScriptModule.psm1>-help.xml
152
- ```
153
-
154
- If the function isn't included in a module, include a path to the XML-based
155
- help file. If the value includes a path and the path contains
156
- UI-culture-specific subdirectories, ` Get-Help ` searches the subdirectories
157
- recursively for an XML file with the name of the script or function in
158
- accordance with the language fallback standards established for Windows, just
159
- as it does in a module directory.
126
+ The ` .EXTERNALHELP ` keyword is required when a function or script is documented in XML files.
127
+ Without this keyword, ` Get-Help ` can't find the XML-based help file for the function or script.
128
+
129
+ The ` .EXTERNALHELP ` keyword takes precedence over other comment-based help keywords. If
130
+ ` .EXTERNALHELP ` is present, ` Get-Help ` doesn't display comment-based help, even if it can't find a
131
+ help topic that matches the value of the ` .EXTERNALHELP ` keyword.
132
+
133
+ If the function is exported by a module, set the value of the ` .EXTERNALHELP ` keyword to a filename
134
+ without a path. ` Get-Help ` looks for the specified filename in a language-specific subdirectory of
135
+ the module directory. There are no requirements for the name of the XML-based help file for a
136
+ function. Beginning in PowerShell 5.0, functions that are exported by a module can be documented in
137
+ a help file that's named for the module. You don't need to use ` .EXTERNALHELP ` comment keyword. For
138
+ example, if the ` Test-Function ` function is exported by the ` MyModule ` module, you can name the help
139
+ file ` MyModule-help.xml ` . The ` Get-Help ` cmdlet looks for help for the ` Test-Function ` function in
140
+ the ` MyModule-help.xml ` file in the module directory.
141
+
142
+ If the function isn't included in a module, include a path to the XML-based help file. If the value
143
+ includes a path and the path contains UI-culture-specific subdirectories, ` Get-Help ` searches the
144
+ subdirectories recursively for an XML file with the name of the script or function in accordance
145
+ with the language fallback standards established for Windows, just as it does in a module directory.
160
146
161
147
For more information about the cmdlet help XML-based help file format, see
162
148
[ How to Write Cmdlet Help] [ 01 ] .
0 commit comments