Ensure all the metadata is added to CommandHelp #784
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request introduces enhancements to how metadata is extracted and processed for
CommandHelp
objects in theMarkdownReader
andTransform
modules. These changes improve the handling of optional metadata fields and ensure better compatibility with external help files and schema versions.Enhancements to metadata handling:
src/MarkdownReader/CommandHelpMarkdownReader.cs
: Added support for extracting additional metadata fields (ExternalHelpFile
,SchemaVersion
,OnlineVersionUrl
, andModuleGuid
) from the parsed markdown content. These fields are now assigned to theCommandHelp
object, with appropriate default values for missing entries. ([src/MarkdownReader/CommandHelpMarkdownReader.csR227-R233](https://github.com/PowerShell/platyPS/pull/784/files#diff-2b2e6a603c33dbdccc6d0bb591d4d3dd530c741130ac94757d7b754744853476R227-R233)
)src/Transform/TransformBase.cs
: Enhanced theConvertCmdletInfo
method to includeSchemaVersion
and improve the logic for assigningOnlineVersionUrl
. The method now prioritizes theHelpUri
metadata field when theSettings.OnlineVersionUrl
is not provided. ([src/Transform/TransformBase.csL57-R61](https://github.com/PowerShell/platyPS/pull/784/files#diff-0dbc578bebc8903843082ecba5daf89936c0af78f376c14f7e2b068ae11996f0L57-R61)
)PR Context