mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add Aliases to the properties shown up when formatting the help content of the parameter returned by Get-Help (#20994)
This commit is contained in:
+4
-1
@@ -350,7 +350,7 @@ if (($_.relatedLinks -ne $()) -and ($_.relatedLinks.navigationLink -ne $()) -and
|
||||
.AddNewline()
|
||||
.AddText(HelpDisplayStrings.ParameterPosition)
|
||||
.AddScriptBlockExpressionBinding(@" ", selectedByScript: @"($_.position -eq $()) -or ($_.position -eq '')", customControl: control7)
|
||||
.AddScriptBlockExpressionBinding(@"$_.position", selectedByScript: "$_.position -ne $()")
|
||||
.AddScriptBlockExpressionBinding(@"$_.position", selectedByScript: "$_.position -ne $()")
|
||||
.AddNewline()
|
||||
.AddText(HelpDisplayStrings.ParameterDefaultValue)
|
||||
.AddPropertyExpressionBinding(@"defaultValue")
|
||||
@@ -358,6 +358,9 @@ if (($_.relatedLinks -ne $()) -and ($_.relatedLinks.navigationLink -ne $()) -and
|
||||
.AddText(HelpDisplayStrings.AcceptsPipelineInput)
|
||||
.AddPropertyExpressionBinding(@"pipelineInput")
|
||||
.AddNewline()
|
||||
.AddText(HelpDisplayStrings.ParameterAliases)
|
||||
.AddPropertyExpressionBinding(@"aliases")
|
||||
.AddNewline()
|
||||
.AddText(HelpDisplayStrings.AcceptsWildCardCharacters)
|
||||
.AddPropertyExpressionBinding(@"globbing", customControl: MamlTrueFalseShortControl)
|
||||
.AddNewline()
|
||||
|
||||
@@ -112,6 +112,15 @@ Describe "Validate that get-help works for CurrentUserScope" -Tags @('CI') {
|
||||
$help.Description | Out-String | Should -Match $cmdletName
|
||||
$help.Examples | Out-String | Should -Match $cmdletName
|
||||
}
|
||||
|
||||
It "Validate 'Aliases' is present in help content formatting" {
|
||||
## The parameter help content should be formatted with the following section:
|
||||
## Accept pipeline input? xxxx
|
||||
## Aliases NoOverwrite
|
||||
## Accept wildcard characters? xxxx
|
||||
$output = Get-Help Import-Module -Parameter NoClobber | Out-String
|
||||
$output | Should -Match "Accept pipeline input\?.*\n\s+Aliases\s+NoOverwrite.*\n\s+Accept wildcard characters\?.*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user