diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs
index 987ed33fb4..d04ea1bded 100644
--- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs
+++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs
@@ -525,6 +525,9 @@ else { '-{0}{1} ' }) -f $_.Name, $parameterValue")
.AddText(HelpDisplayStrings.ParameterIsDynamic)
.AddPropertyExpressionBinding(@"isDynamic")
.AddNewline()
+ .AddText(HelpDisplayStrings.AcceptsWildCardCharacters)
+ .AddPropertyExpressionBinding(@"globbing")
+ .AddNewline()
.AddNewline()
.EndFrame()
.EndEntry()
@@ -711,6 +714,9 @@ else { '-{0}{1} ' }) -f $_.Name, $parameterValue")
.AddText(HelpDisplayStrings.ParameterIsDynamic)
.AddPropertyExpressionBinding(@"isDynamic")
.AddNewline()
+ .AddText(HelpDisplayStrings.AcceptsWildCardCharacters)
+ .AddPropertyExpressionBinding(@"globbing")
+ .AddNewline()
.AddNewline()
.EndFrame()
.EndEntry()
diff --git a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs
index b8be27e99a..8035e7e502 100644
--- a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs
+++ b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs
@@ -423,6 +423,7 @@ namespace System.Management.Automation.Help
obj.Properties.Add(new PSNoteProperty("description", string.Empty));
obj.Properties.Add(new PSNoteProperty("position", string.Empty));
obj.Properties.Add(new PSNoteProperty("aliases", string.Empty));
+ obj.Properties.Add(new PSNoteProperty("globbing", string.Empty));
}
else
{
@@ -442,6 +443,7 @@ namespace System.Management.Automation.Help
obj.Properties.Add(new PSNoteProperty("required", CultureInfo.CurrentCulture.TextInfo.ToLower(paramAttribute.Mandatory.ToString())));
obj.Properties.Add(new PSNoteProperty("pipelineInput", GetPipelineInputString(paramAttribute)));
obj.Properties.Add(new PSNoteProperty("isDynamic", CultureInfo.CurrentCulture.TextInfo.ToLower(dynamic.ToString())));
+ AddParameterGlobbingProperties(obj, attributes);
if (paramAttribute.ParameterSetName.Equals(ParameterAttribute.AllParameterSets, StringComparison.OrdinalIgnoreCase))
{
@@ -517,6 +519,27 @@ namespace System.Management.Automation.Help
}
}
+ ///
+ /// Adds the globbing properties.
+ ///
+ /// HelpInfo object.
+ /// The attributes of the parameter (needed to look for PSTypeName).
+ private static void AddParameterGlobbingProperties(PSObject obj, IEnumerable attributes)
+ {
+ bool globbing = false;
+
+ foreach (var attrib in attributes)
+ {
+ if (attrib is SupportsWildcardsAttribute)
+ {
+ globbing = true;
+ break;
+ }
+ }
+
+ obj.Properties.Add(new PSNoteProperty("globbing", CultureInfo.CurrentCulture.TextInfo.ToLower(globbing.ToString())));
+ }
+
///
/// Adds the parameterType properties.
///
diff --git a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1
index b1e6d0849c..8824d96209 100644
--- a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1
+++ b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1
@@ -614,6 +614,33 @@ Describe 'get-help other tests' -Tags "CI" {
It '$x.Parameters.parameter[2].defaultValue' { $x.Parameters.parameter[2].defaultValue | Should -BeExactly 'parameter is mandatory' }
}
+ Context 'get-help helpFunc14' {
+ function helpFunc14
+ {
+ param(
+ [SupportsWildcards()]
+ $p1
+ )
+ }
+
+ $x = Get-Help helpFunc14
+
+ It '$x.Parameters.parameter[0].globbing' { $x.Parameters.parameter[0].globbing | Should -BeExactly 'true' }
+ }
+
+ Context 'get-help helpFunc15' {
+ function helpFunc15
+ {
+ param(
+ $p1
+ )
+ }
+
+ $x = Get-Help helpFunc15
+
+ It '$x.Parameters.parameter[0].globbing' { $x.Parameters.parameter[0].globbing | Should -BeExactly 'false' }
+ }
+
Context 'get-help -Examples prompt string should have trailing space' {
function foo {
<#