From 4fa8982d263aab61c98eb9174cc133e0be1d0ede Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Tue, 27 Jan 2026 12:35:26 +0100 Subject: [PATCH 1/2] Input/Output type should read tokens of the inputOutputHeader. For example: System.String[] would previously be read as the first token, 'System.String', and skip the second and third ('[', ']'). --- src/MarkdownReader/CommandHelpMarkdownReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkdownReader/CommandHelpMarkdownReader.cs b/src/MarkdownReader/CommandHelpMarkdownReader.cs index 5d85e244..4233c493 100644 --- a/src/MarkdownReader/CommandHelpMarkdownReader.cs +++ b/src/MarkdownReader/CommandHelpMarkdownReader.cs @@ -962,7 +962,7 @@ internal static List GetInputOutput(ParsedMarkdownContent md) { if (md.GetCurrent() is HeadingBlock inputOutputHeader) { - string inputType = inputOutputHeader?.Inline?.FirstChild?.ToString() ?? string.Empty; + string inputType = string.Join("", inputOutputHeader.Inline ?? []); md.Take(); if (md.GetCurrent() is ParagraphBlock pBlock) { From 30162d58a4fc9ce5edee8b5452852d58d503c734 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Tue, 27 Jan 2026 12:56:37 +0100 Subject: [PATCH 2/2] Add tests for input validation in Import-MarkdownCommandHelp --- test/Pester/ImportMarkdownCommandHelp.Tests.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/Pester/ImportMarkdownCommandHelp.Tests.ps1 b/test/Pester/ImportMarkdownCommandHelp.Tests.ps1 index 070404a0..6cc161de 100644 --- a/test/Pester/ImportMarkdownCommandHelp.Tests.ps1 +++ b/test/Pester/ImportMarkdownCommandHelp.Tests.ps1 @@ -121,12 +121,19 @@ Describe 'Import-MarkdownCommandHelp Tests' { BeforeAll { $ch1 = Import-MarkdownCommandHelp "$PSScriptRoot/assets/Compare-CommandHelp.md" $ch2 = Import-MarkdownCommandHelp "$PSScriptRoot/assets/Get-ChildItem.md" + $ch3 = Import-MarkdownCommandHelp "$PSScriptRoot/assets/Remove-SqlSensitivityClassification.md" } It "Should have the proper input content" { $ch1.Inputs.Count | Should -Be 1 $ch1.Inputs[0].TypeName | Should -BeExactly "System.Management.Automation.HiThere" $ch1.Inputs[0].Description | Should -Be "" + + $ch3.Inputs.Count | Should -Be 2 + $ch3.Inputs[0].TypeName | Should -BeExactly "System.String[]" + $ch3.Inputs[0].Description | Should -Be "" + $ch3.Inputs[1].TypeName | Should -BeExactly "Microsoft.SqlServer.Management.Smo.Database" + $ch3.Inputs[1].Description | Should -Be "" } It "Should have the proper output content" {