Skip to content

PlatyPS: strict mode breaks New-CommandHelp (PowerShell/platyPS#800) #246

Description

@bravo-kernel

Tracks an upstream PlatyPS bug we currently shim around. Context: #241 (v2 migration).

Problem

Any caller-scope Set-StrictMode makes New-CommandHelp throw The property '<name>' cannot be found on this object, because PlatyPS uses C# dynamic member access on the Get-Help PSObject and that honors the caller's strict mode. Our build prefix enables Set-StrictMode -Version Latest module-wide, so without a workaround every PlatyPS call we make would fail — even for commands with complete help.

Our mitigation

Source/Public/New-DocusaurusHelp.ps1 wraps every PlatyPS cmdlet call in a child scope that runs Set-StrictMode -Off (two call sites, both commented with a link to the upstream issue).

Upstream

Retire when

An upstream fix ships in a PlatyPS release newer than our RequiredModules pin (currently 1.0.2): bump the pin, remove the Set-StrictMode -Off wrappers, and confirm the golden fixtures pass unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalExternal Dependency

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions