Skip to content

Update PlatyPS dependency from platyPS v0.14.x to Microsoft.PowerShell.PlatyPS v1.x #105

@HeyItsGilbert

Description

@HeyItsGilbert

Summary

The platyPS module (v0.14.2) used by PowerShellBuild is no longer supported. Microsoft has released a complete rewrite named Microsoft.PowerShell.PlatyPS v1.x, which is now the supported version. This issue tracks migrating all three platyPS-dependent public functions and updating the module dependency.

Reference: https://learn.microsoft.com/en-us/powershell/utility-modules/platyps/overview?view=ps-modules

Affected files

  • requirements.psd1 — dependency declaration
  • PowerShellBuild/Public/Build-PSBuildMarkdown.ps1
  • PowerShellBuild/Public/Build-PSBuildMAMLHelp.ps1
  • PowerShellBuild/Public/Build-PSBuildUpdatableHelp.ps1
  • Existing markdown docs under docs/ — must be migrated to the new schema

Cmdlet mapping

Old (platyPS v0.14.x) New (Microsoft.PowerShell.PlatyPS v1.x)
New-MarkdownHelp New-MarkdownCommandHelp
Update-MarkdownHelp Import-MarkdownCommandHelp | Export-MarkdownCommandHelp
New-ExternalHelp Import-MarkdownCommandHelp | Export-MamlCommandHelp
New-ExternalHelpCab Import-MarkdownCommandHelp | Export-MamlCommandHelp (cab via pipeline)

Tasks

  • Update requirements.psd1 to replace platyPS = '0.14.2' with Microsoft.PowerShell.PlatyPS = '1.0.1'
  • Update Build-PSBuildMarkdown to use New-MarkdownCommandHelp / Import-MarkdownCommandHelp | Export-MarkdownCommandHelp
  • Update Build-PSBuildMAMLHelp to use Import-MarkdownCommandHelp | Export-MamlCommandHelp
  • Update Build-PSBuildUpdatableHelp to use the new cab pipeline
  • Migrate existing docs/ markdown files to the new schema using Measure-PlatyPSMarkdown | Import-MarkdownCommandHelp | Export-MarkdownCommandHelp
  • Update CI (requirements.psd1 / GitHub Actions) to install the new module name
  • Verify Get-Help output is correct end-to-end after migration

Migration note for existing markdown

The new module ships Measure-PlatyPSMarkdown specifically to detect old-schema files and pipe them through the conversion:

$mdfiles = Measure-PlatyPSMarkdown -Path .\docs\en-US\*.md
$mdfiles | Where-Object Filetype -match 'CommandHelp' |
    Import-MarkdownCommandHelp -Path { $_.FilePath } |
    Export-MarkdownCommandHelp -OutputFolder .\docs\en-US -Force

Run this once as part of the migration to bring existing markdown into the new schema before updating the build functions.

Notes

  • The new module is a full C# rewrite using markdig (the same parser used by Microsoft Learn), so parsing is significantly more accurate and faster.
  • The new CommandHelp object model is pipeline-friendly — the Import-* | Export-* pattern replaces most single-step cmdlets from v0.14.x.
  • platyPS v0.14.2 is still installable from the Gallery but receives no further fixes or updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions