Skip to content

Migrate to Microsoft.PowerShell.PlatyPS and psake v5#55

Open
HeyItsGilbert wants to merge 9 commits intomainfrom
claude/migrate-platyps-v2-psake-v5
Open

Migrate to Microsoft.PowerShell.PlatyPS and psake v5#55
HeyItsGilbert wants to merge 9 commits intomainfrom
claude/migrate-platyps-v2-psake-v5

Conversation

@HeyItsGilbert
Copy link
Copy Markdown
Member

Summary

  • Replaces the dead Alt3.Docusaurus.Powershell + PlatyPS v0 pipeline with Microsoft.PowerShell.PlatyPS (v2 schema)
  • Adds scripts/New-PsakeDocusaurusHelp.ps1 — a custom transformer that converts PlatyPS v2 markdown (tables, new frontmatter) into the same Docusaurus MDX format the site already uses
  • Bumps psake to 5.0.3 and adopts v5 features: Version 5 declaration, declarative hashtable task syntax, Inputs/Outputs caching on Init, exec {} wrappers for external commands
  • Adds -Quiet flag to build.ps1 for structured PsakeBuildResult output — reduces token usage when running from Claude Code
  • Adds 8 new command reference MDX files for psake v5 commands (BuildSetup, BuildTearDown, Clear-PsakeCache, Execute, Get-PsakeBuildPlan, Test-BuildEnvironment, Test-PsakeTask, Version)

Test plan

  • Run .\build.ps1 -Bootstrap to install Microsoft.PowerShell.PlatyPS
  • Run .\build.ps1 -Quiet -Task GenerateCommandReference and inspect docs/commands/Assert.mdx — frontmatter, yaml param fences, .mdx cross-links, and escaped curly braces should all be present
  • Run .\build.ps1 -Quiet -Task Test — all 44 Pester tests pass
  • Run .\build.ps1 -Quiet -Task Build — Docusaurus build completes without broken-link errors

🤖 Generated with Claude Code

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for psake ready!

Name Link
🔨 Latest commit 7c20728
🔍 Latest deploy log https://app.netlify.com/projects/psake/deploys/69f21362b4619c00084ed575
😎 Deploy Preview https://deploy-preview-55--psake.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

HeyItsGilbert and others added 9 commits April 29, 2026 07:19
- Replace Alt3.Docusaurus.Powershell + PlatyPS v0 with Microsoft.PowerShell.PlatyPS
- Add scripts/New-PsakeDocusaurusHelp.ps1 to transform PlatyPS v2 markdown to Docusaurus MDX
- Bump psake to 5.0.3; convert main tasks to v5 declarative hashtable syntax
- Add -Quiet flag to build.ps1 for structured PsakeBuildResult output (reduces token usage)
- Add 8 new command reference MDX files for psake v5 commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The sidebar was generated by the old Alt3 module and only listed 12
commands. The 8 new v5 command MDX files are now included.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add PowerShellBuild module to requirements.psd1
- Add $psbOptions/$psbVersion/$psbOutputFolder to Properties block
- Add GenerateCommandReferencePSB task set (Clean, Gen)
- Wire GenerateCommandReferencePSB into Build task DependsOn
- Add docs/psb-commands/ placeholder sidebar (empty until task runs)
- Import psbCommands in sidebars.ts with conditional category in powershellBuildSidebar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename New-PsakeDocusaurusHelp.ps1 -> New-DocusaurusModuleHelp.ps1
- Rename function to New-DocusaurusModuleHelp (works for any PS module)
- Add CommandVersionMap parameter; injects :::note Since <module> X.Y::: admonition
- Add CommandVersionMap to $docusaurusOptions for the 8 psake v5-only commands
- Update both GenerateCommandReference-Gen and GenerateCommandReferencePSB-Gen to use new script/function
- Remove Exec.mdx (command was renamed to Execute in psake v5; no longer exported)
- Remove 'commands/Exec' from docusaurus.sidebar.js

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…en fix

- psakeFile: add Inputs/Outputs caching to Init and FrontMatterCMSSync tasks
- psakeFile: add PreCondition to GenerateCommandReferencePSB; convert all tasks
  to hashtable syntax; fix #requires statement
- build.ps1: add -NoCache and -OutputFormat params; use splatting for Invoke-Psake
- requirements.psd1: fix 'latest3' typo for psake version
- New-DocusaurusModuleHelp: guard Import-Module with Get-Module check to prevent
  force-reimporting psake mid-run (was blowing away Restore-Environment scope)
- Delete stale scripts/New-PsakeDocusaurusHelp.ps1 (superseded by New-DocusaurusModuleHelp)
- .gitignore: add .psake/ (v5 task cache directory)
- Regenerate all 19 command reference MDX files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- docusaurus.config.ts: fix navbar link Invoke-psake -> Invoke-Psake (case)
- docs/intro.md, docs/tutorial-basics/getting-help.md: same case fix
- New-DocusaurusModuleHelp: skip Convert-ParameterTablesToYamlFences when
  PlatyPS v2 native yaml blocks are present (avoids duplicate yaml and stray
  blocks bleeding into RELATED LINKS section)
- requirements.psd1: add Import=\$false for Pester to prevent PSDepend from
  reimporting already-loaded assemblies on CI (fixes 'Assembly with same name
  is already loaded' bootstrap failure)
- Regenerate all 19 command reference MDX files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2 passthrough

- Switch RELATED LINKS generation from relative .mdx paths to absolute URL paths
  (/docs/<sidebar>/<cmd>) — avoids Linux case-sensitivity issues with git-tracked
  filename (Invoke-psake.mdx vs Invoke-Psake.mdx)
- Rename git-tracked docs/commands/Invoke-psake.mdx -> Invoke-Psake.mdx (correct case)
- Replace backtick line continuation with splat in ConvertTo-DocusaurusMdx call
- Regenerate all 19 MDX files; local bun build passes with no broken links

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PlatyPS v2 changed from v1 behavior: example code is now emitted as plain
text instead of fenced code blocks. Detect the first paragraph of each
### EXAMPLE section and wrap it in ```powershell fences. The guard
(?!```) prevents double-wrapping if a fence is already present.

Issue is in PlatyPS v2 export behavior, not in psake CBH (which correctly
uses C:\PS> prompt prefix convention that PlatyPS strips).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove ## ALIASES section when it contains only the no-aliases placeholder
  (PlatyPS v2 emits this for every command with no real aliases)
- Remove '{{ Fill in the related links here }}' from RELATED LINKS sections
- Warn via Write-Warning for any remaining {{...}} placeholders after cleanup
  (currently: Include, Invoke-Psake, Test-BuildEnvironment have unfilled
  Description fields in their CBH — these should be fixed upstream in psake)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HeyItsGilbert HeyItsGilbert force-pushed the claude/migrate-platyps-v2-psake-v5 branch from b4fe974 to 7c20728 Compare April 29, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant