r/PowerShell • u/xXFl1ppyXx • May 18 '26
Question Get-Help Informations missing
I'm in the middle of decorating some older functions with HelpMessages / Get-Help Infos. Somehow i can't get the output to work without adding "junk information". Specifically Aliases, Parameter-Sets and Default Values:
This Function:
function Test-FunctionHelp {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER TestParameter
.EXAMPLE
Test-FunctionHelp -TestParameter "Parameter"
#>
[CmdletBinding()]
[Alias('tfh')]
param (
[Parameter()]
[Alias('ParameterAlias')]
[string]$TestParameter
)
}
Get-Help "Test-FunctionHelp" -FullOutputs this Help:
NAME
Test-FunctionHelp
SYNOPSIS
SYNTAX
Test-FunctionHelp [[-TestParameter] <String>] [<CommonParameters>]
DESCRIPTION
PARAMETERS
-TestParameter <String>
Required? false
Position? 1
Default value
Accept pipeline input? false
Aliases
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS > Test-FunctionHelp -TestParameter "Parameter"
RELATED LINKSWhile adding junk at the last part of of the Help Block like this:
function Test-FunctionHelp {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER TestParameter
.EXAMPLE
Test-FunctionHelp -TestParameter "Parameter"
.A
#>
[CmdletBinding()]
[Alias('tfh')]
param (
[Parameter()]
[Alias('ParameterAlias')]
[string]$TestParameter
)
}
Get-Help "Test-FunctionHelp" -FullOutputs the expected Helpmessage:
NAME
Test-FunctionHelp
SYNTAX
Test-FunctionHelp [[-TestParameter] <string>] [<CommonParameters>]
PARAMETERS
-TestParameter <string>
Required? false
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases ParameterAlias
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
System.Object
-------------------------- EXAMPLE 1 --------------------------
PS > Test-FunctionHelp -TestParameter "Parameter"
ALIASES
tfh
REMARKS
NoneIs there anything i'm missing? It's not that big of a deal but i'm wondering why some things are not picked up properly without adding some junk into the Help-Block. Am i missing something particulary important in the help block?
Btw it doesn't matter at what point i add the "junk"
all of those examples work as intended:
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER TestParameter
.EXAMPLE
Test-FunctionHelp -TestParameter "Parameter"
.A
#>
<#
.A
.SYNOPSIS
.DESCRIPTION
.PARAMETER TestParameter
.EXAMPLE
Test-FunctionHelp -TestParameter "Parameter"
#>
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER TestParameter
.EXAMPLE
.A
Test-FunctionHelp -TestParameter "Parameter"
#>
View all comments
Show parent comment
3
u/odwulf May 18 '26
I always put in at the start of the function, and always removed extra line breaks, without any problem, Do you have pointers as to why putting it at the end would be better?