feat: initial PowerShell module base scaffold#1
Merged
Conversation
Full project template with: - src/MyModule/ layout (Public/ Private/ one-file-per-function) - Pester 5 unit tests with JaCoCo coverage - PSScriptAnalyzer configuration (all severities, formatting rules) - Invoke-Build task script (lint, test, build, docs, publish) - platyPS documentation generation - GitHub Actions CI (lint, test, security, build) - GitHub Actions publish pipeline (PSGallery, GitHub Packages, ADO Artifacts) - Dev container (PowerShell 7.4) - VS Code settings, extensions, launch configs - Claude Code helper commands - README with publishing paths for PSGallery / GitHub Packages / ADO Artifacts - CLAUDE.md AI context
- Build.ps1: Manifest task auto-discovers Public/ functions + validates GUID; Build produces a monolithic PSM1 for distribution with explicit exports - PSD1: FunctionsToExport = '*' in src (dev/test); build writes explicit list - CI: install all tools once up-front, then delegate to Invoke-Build tasks; cross-platform matrix (Linux/Windows/macOS) with Pester wired correctly - Get-Example.ps1: richer comment-based help (all sections, multiple examples) - docs/about_MyModule.md: proper module-level about_ help file - README + CLAUDE.md: full rewrite with clearer structure
Bugs fixed:
- B1: ci.yml test job had -MinimumVersion @{Pester='5.0'} (invalid syntax);
split into separate Install-Module calls
- B2: Manifest task no longer called from Build; Build never touches source files.
Manifest task uses [regex]::Replace to preserve comments (no Update-ModuleManifest
on source). Build uses inline regex to update only the .build/ manifest copy
- B3: PowerShellGet no longer needed in CI; manifest updates use regex throughout
- B4: Added .TrimEnd() to monolithic PSM1 concatenation to prevent double-newlines
from CRLF source files
Design improvements:
- D1: publish.yml now extracts version from tag (v1.2.3 -> 1.2.3) and patches
ModuleVersion in the built manifest before uploading artifact
- D2: Pester coverage threshold added (80% CoveragePercentTarget)
- D3: Test-ModuleManifest called after Build to validate manifest before publish
- D4: Docs task now calls New-ExternalHelp to compile MAML into en-US/;
Get-Help about_MyModule now works for installed module
- D5: Get-Example gains begin{} and end{} blocks with usage guidance
- D6: Added test for ValueFromPipelineByPropertyName
- D7: PSAlignAssignmentStatement moved to ExcludeRules (too noisy in practice)
- D8: Publish artifact name includes tag version
- D9: CompatiblePSEditions = @('Core') added to manifest (PS 7 = Core only)
Minor:
- devcontainer postCreateCommand uses array form (avoids shell quoting issues)
- Added SECURITY.md placeholder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Complete PowerShell module base template — ready to clone and rename.
What's included
src/MyModule/— Public/Private source layout, dev loader PSM1, manifesttests/Unit/— Pester 5 tests for public and private functionsBuild.ps1— Invoke-Build tasks: Lint, Test, Manifest, Build, Docs, Publish*PSScriptAnalyzerSettings.psd1— all-severity rules, tuned to avoid noise.github/workflows/ci.yml— lint + test (Linux/Windows/macOS) + security + build.github/workflows/publish.yml— PSGallery + GitHub Packages + ADO Artifacts on tag.devcontainer/devcontainer.json— PowerShell 7.4 dev containerdocs/about_MyModule.md— module help; cmdlet pages auto-generated by platyPSCLAUDE.md,README.md,SECURITY.md,CHANGELOG.mdKey design decisions
.build/for distribution; dot-source loader insrc/for devFunctionsToExportauto-discovered fromPublic/at build timeTest-ModuleManifestvalidates build output before publishGenerated by Claude Code