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
0
u/dodexahedron May 18 '26 edited May 18 '26
Just the about_Comment_Based_Help, which (at least used to) suggest it. Haven't read through it in full, recently, though.
That and in psm1 modules it can get goofy because of course things can't be consistent. One I wrote just a couple days ago didn't work at the start but did with the exact block moved to the end (literally selected and dragged to end) where I usually put it. Don't even know why I put it at the start that time. 😅
As for the other buggy behavior, I've never not been able to get CBH working properly by moving things to a different location. End has been most consistently functional IME. 🤷♂️
And I've never had to add junk elements, either. That part is a big red flag to me.