Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
ms.date: 06/09/2017
schema: 2.0.0
keywords: powershell,cmdlet
Expand All @@ -7,7 +7,6 @@ title: about_Comment_Based_Help
# About Comment Based Help

## SHORT DESCRIPTION

Describes how to write comment-based help topics for functions and scripts.

## LONG DESCRIPTION
Expand Down Expand Up @@ -100,7 +99,7 @@ function Get-Function
<help content>
#>

<function commands>
# function logic
}
```

Expand All @@ -109,7 +108,7 @@ or
```powershell
function Get-Function
{
<function commands>
# function logic

<#
.<help keyword>
Expand Down Expand Up @@ -285,8 +284,8 @@ 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.

```
.FORWARDHELPTARGETNAME <Command-Name>
```powershell
# .FORWARDHELPTARGETNAME <Command-Name>
```

### .FORWARDHELPCATEGORY
Expand All @@ -296,8 +295,8 @@ 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.

```
.FORWARDHELPCATEGORY <Category>
```powershell
# .FORWARDHELPCATEGORY <Category>
```

### .REMOTEHELPRUNSPACE
Expand All @@ -307,16 +306,16 @@ contains a "PSSession". This keyword is used by the
[Export-PSSession](../../Microsoft.PowerShell.Utility/Export-PSSession.md)
cmdlet to find the help topics for the exported commands.

```
.REMOTEHELPRUNSPACE <PSSession-variable>
```powershell
# .REMOTEHELPRUNSPACE <PSSession-variable>
```

### .EXTERNALHELP

Specifies an XML-based help file for the script or function.

```
.EXTERNALHELP <XML Help File>
```powershell
# .EXTERNALHELP <XML Help File>
```

The "ExternalHelp" keyword is required when a function or script is documented
Expand Down Expand Up @@ -470,7 +469,7 @@ The results are as follows:
Get-Help -Name "Add-Extension" -Full
```

```
```Output
NAME

Add-Extension
Expand Down Expand Up @@ -677,7 +676,7 @@ command that gets the script help must specify the script path.
Get-Help -Path .\update-month.ps1 -Full
```

```
```Output
# NAME

C:\ps-test\Update-Month.ps1
Expand Down Expand Up @@ -762,7 +761,7 @@ Note that the value of the "ExternalHelp" keyword appears on the same
line as the keyword. Any other placement is ineffective.

```powershell
.ExternalHelp C:\MyScripts\Update-Month-Help.xml
# .ExternalHelp C:\MyScripts\Update-Month-Help.xml

param ([string]$InputPath, [string]$OutPutPath)
function Get-Data { }
Expand All @@ -775,7 +774,7 @@ keyword in a function.
```powershell
function Add-Extension
{
.ExternalHelp C:\ps-test\Add-Extension.xml
# .ExternalHelp C:\ps-test\Add-Extension.xml

param ([string] $name, [string]$extension = "txt")
$name = $name + "." + $extension
Expand All @@ -790,12 +789,12 @@ param ([string] $name, [string]$extension = "txt")
$name = $name + "." + $extension
$name

.ExternalHelp C:\ps-test\Add-Extension.xml
# .ExternalHelp C:\ps-test\Add-Extension.xml
}
```

```powershell
.ExternalHelp C:\ps-test\Add-Extension.xml
# .ExternalHelp C:\ps-test\Add-Extension.xml
function Add-Extension
{
param ([string] $name, [string]$extension = "txt")
Expand Down Expand Up @@ -835,14 +834,14 @@ The following command uses this feature:
Get-Help -Name help
```

```
```Output
NAME

Get-Help

SYNOPSIS

Displays information about Windows PowerShell cmdlets and concepts.
Displays information about PowerShell cmdlets and concepts.
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ title: about_Comment_Based_Help
# About Comment Based Help

## SHORT DESCRIPTION

Describes how to write comment-based help topics for functions and scripts.

## LONG DESCRIPTION
Expand Down Expand Up @@ -100,7 +99,7 @@ function Get-Function
<help content>
#>

<function commands>
# function logic
}
```

Expand All @@ -109,7 +108,7 @@ or
```powershell
function Get-Function
{
<function commands>
# function logic

<#
.<help keyword>
Expand Down Expand Up @@ -285,8 +284,8 @@ 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.

```
.FORWARDHELPTARGETNAME <Command-Name>
```powershell
# .FORWARDHELPTARGETNAME <Command-Name>
```

### .FORWARDHELPCATEGORY
Expand All @@ -296,8 +295,8 @@ 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.

```
.FORWARDHELPCATEGORY <Category>
```powershell
# .FORWARDHELPCATEGORY <Category>
```

### .REMOTEHELPRUNSPACE
Expand All @@ -307,16 +306,16 @@ contains a "PSSession". This keyword is used by the
[Export-PSSession](../../Microsoft.PowerShell.Utility/Export-PSSession.md)
cmdlet to find the help topics for the exported commands.

```
.REMOTEHELPRUNSPACE <PSSession-variable>
```powershell
# .REMOTEHELPRUNSPACE <PSSession-variable>
```

### .EXTERNALHELP

Specifies an XML-based help file for the script or function.

```
.EXTERNALHELP <XML Help File>
```powershell
# .EXTERNALHELP <XML Help File>
```

The "ExternalHelp" keyword is required when a function or script is documented
Expand Down Expand Up @@ -440,17 +439,17 @@ or file name.

.EXAMPLE

C:\PS> extension -name "File"
PS> extension -name "File"
File.txt

.EXAMPLE

C:\PS> extension -name "File" -extension "doc"
PS> extension -name "File" -extension "doc"
File.doc

.EXAMPLE

C:\PS> extension "File" "doc"
PS> extension "File" "doc"
File.doc

.LINK
Expand All @@ -470,7 +469,7 @@ The results are as follows:
Get-Help -Name "Add-Extension" -Full
```

```
```Output
NAME

Add-Extension
Expand Down Expand Up @@ -525,17 +524,17 @@ file name.

Example 1

C:\PS> extension -name "File"
PS> extension -name "File"
File.txt

Example 2

C:\PS> extension -name "File" -extension "doc"
PS> extension -name "File" -extension "doc"
File.doc

Example 3

C:\PS> extension "File" "doc"
PS> extension "File" "doc"
File.doc

RELATED LINKS
Expand Down Expand Up @@ -589,17 +588,17 @@ file name.

.EXAMPLE

C:\PS> extension -name "File"
PS> extension -name "File"
File.txt

.EXAMPLE

C:\PS> extension -name "File" -extension "doc"
PS> extension -name "File" -extension "doc"
File.doc

.EXAMPLE

C:\PS> extension "File" "doc"
PS> extension "File" "doc"
File.doc

.LINK
Expand Down Expand Up @@ -651,15 +650,15 @@ None. Update-Month.ps1 does not generate any output.

.EXAMPLE

C:\PS> .\Update-Month.ps1
PS> .\Update-Month.ps1

.EXAMPLE

C:\PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv
PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv

.EXAMPLE

C:\PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv -outputPath `
PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv -outputPath `
C:\Reports\2009\January.csv
#>

Expand All @@ -677,7 +676,7 @@ command that gets the script help must specify the script path.
Get-Help -Path .\update-month.ps1 -Full
```

```
```Output
# NAME

C:\ps-test\Update-Month.ps1
Expand Down Expand Up @@ -734,15 +733,15 @@ None. Update-Month.ps1 does not generate any output.

Example 1

C:\PS> .\Update-Month.ps1
PS> .\Update-Month.ps1

Example 2

C:\PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv
PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv

Example 3

C:\PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv -outputPath
PS> .\Update-Month.ps1 -inputpath C:\Data\January.csv -outputPath
C:\Reports\2009\January.csv

# RELATED LINKS
Expand All @@ -762,7 +761,7 @@ Note that the value of the "ExternalHelp" keyword appears on the same
line as the keyword. Any other placement is ineffective.

```powershell
.ExternalHelp C:\MyScripts\Update-Month-Help.xml
# .ExternalHelp C:\MyScripts\Update-Month-Help.xml

param ([string]$InputPath, [string]$OutPutPath)
function Get-Data { }
Expand All @@ -775,7 +774,7 @@ keyword in a function.
```powershell
function Add-Extension
{
.ExternalHelp C:\ps-test\Add-Extension.xml
# .ExternalHelp C:\ps-test\Add-Extension.xml

param ([string] $name, [string]$extension = "txt")
$name = $name + "." + $extension
Expand All @@ -790,12 +789,12 @@ param ([string] $name, [string]$extension = "txt")
$name = $name + "." + $extension
$name

.ExternalHelp C:\ps-test\Add-Extension.xml
# .ExternalHelp C:\ps-test\Add-Extension.xml
}
```

```powershell
.ExternalHelp C:\ps-test\Add-Extension.xml
# .ExternalHelp C:\ps-test\Add-Extension.xml
function Add-Extension
{
param ([string] $name, [string]$extension = "txt")
Expand Down Expand Up @@ -835,14 +834,14 @@ The following command uses this feature:
Get-Help -Name help
```

```
```Output
NAME

Get-Help

SYNOPSIS

Displays information about Windows PowerShell cmdlets and concepts.
Displays information about PowerShell cmdlets and concepts.
...
```

Expand Down
Loading