Conversation
- Added a new cspell.json file for spell checking with custom words related to the project. - Updated documentation for Get-PlasterTemplate, Invoke-Plaster, New-PlasterManifest, and Test-PlasterManifest cmdlets to include the new -ProgressAction parameter. - Modified psakeFile.ps1 to set up build preferences and dependencies more efficiently. - Introduced requirements.psd1 to manage module dependencies and their versions.
* Updated `actions/checkout` to version 4 * Added caching for PowerShell modules using `psmodulecache` * Improved module dependency handling in the workflow * Added `plaster` to the spell-checker ignore list in `cspell.json`
* Added `permissions` for `checks` and `issues` in the workflow. * Updated `actions/upload-artifact` to version `v4.6.2`. * Updated `actions/download-artifact` to version `v4.3.0`. * Updated `EnricoMi/publish-unit-test-result-action` to version `v2.20.0`.
* Changed `issues: write` to `pull-requests: write` for better clarity on permissions. * Updated condition for the `publish-test-results` job to `if: (!cancelled())` for improved control flow.
* Introduced `Help.tests.ps1` to validate command help and parameters.
* Added `.markdownlint.json` for markdown linting configuration. * Updated `.vscode/settings.json` to include final newline and space settings. * Enhanced `CHANGELOG.md` to follow the Keep a Changelog format. * Fixed encoding issues in multiple XML and JSON files. * Refactored test scripts to improve variable scoping and clarity. * Updated `psakeFile.ps1` to include additional build directories.
* Ensure the build script is executed if the environment variable `BHProjectPath` is not set. * This change is applied across multiple test files to maintain consistency in the test setup.
- The function checks for culture-specific, parent culture, and invariant culture manifests. - Added parameter validation and detailed documentation for usage. - Updated references in `Invoke-Plaster` to use the new function name. - Created tests to ensure functionality and correctness of the new implementation.
…ng tests * Introduced the `Initialize-PredefinedVariables` function to set up essential variables for Plaster template processing. * Updated `Invoke-Plaster` to call the new function with appropriate parameters. * Added tests for `Initialize-PredefinedVariables` to ensure correct initialization of predefined variables. * Modified `.vscode/settings.json` to refine search exclusion patterns.
…e-PlasterLog` functions * Added detailed synopsis, description, parameters, examples, and notes to improve clarity and usability. * Ensured consistent logging and error handling across operations within the Plaster module.
…tests * Introduced `Resolve-ModuleVersionString` to parse version strings into valid version objects. * Replaced the inline version parsing logic in `Get-ModuleExtension` with a call to `Resolve-ModuleVersionString`. * Added tests for `Resolve-ModuleVersionString` to ensure correct functionality and error handling.
* Rename existing function * Supports an optional parameter to list all available modules or only the latest version of each module. * Includes detailed documentation and examples for ease of use.
* Refactor test structure for improved readability * Ensure all predefined variables are initialized correctly * Validate that `PLASTER_TemplatePath` and `PLASTER_DestinationPath` match expected values
* Changed the mock for `Get-Module` to use `Import-Clixml` for better clarity and consistency. * This improves the readability of the test setup and aligns with the expected data handling.
- Implemented `Test-JsonManifestContent` to validate content actions in Plaster manifests, ensuring required properties are present for each action type. - Created `Test-JsonManifestParameters` to validate parameters in Plaster manifests, checking for required properties, valid names, and types. - Added `Test-PlasterCondition` to validate the syntax of conditions in manifests. - Updated `Invoke-Plaster` to streamline parameter handling and improve manifest loading logic. - Removed the deprecated `Write-PlasterLog` function to simplify logging. - Enhanced documentation for `Invoke-Plaster` and `New-PlasterManifest` to reflect new parameter options and usage. - Added comprehensive tests for `New-PlasterManifest` to ensure correct manifest generation and validation. - Adjusted tests for `RequireModule` and `TestPlasterManifest` to align with new validation logic and output expectations.
* Added a TODO comment for clarity in `JsonTest.Tests.ps1`. * Modified path handling in `PlasterManifestValidation.Tests.ps1` to ensure compatibility across platforms.
* Changed the path in the `<modify>` tag from `$env:LOCALAPPDATA\tasks-should-not-be-here.json` to `{0}tasks-should-not-be-here.json` for better compatibility.
* Added checks for `$env:BHProjectPath` and adjusted paths for module imports. * Set up output directory more robustly. * Changed `Invoke-Plaster` to use `-WhatIf` for safer execution.
Updated readme.md file
* Added checks to ensure both `source` and `destination` properties are provided for `file` and `templateFile` actions. * Enhanced error messages for better clarity on missing properties. * Updated JSON manifest example to reflect the change from `file` to `directory` type for better structure.
* Updated `ModuleVersion` in the manifest to reflect the beta release. * Changed `ReleaseNotes` to point to the complete changelog URL for better accessibility.
* Removed extra space in branch name definition. * Updated `psmodulecache` action version from `v5.1` to `v6.0`.
* Replaced the PowerShell module caching step with ModuleFast action. * Updated the specification format for better readability and maintainability.
* Updated the `uses` directive for `ModuleFast-action` to specify version `v0.0.1`. * Ensures compatibility and stability in the publishing process.
* Introduced a new `Compare-SemanticVersion` function to handle semantic version comparisons. * Enhanced version comparison to account for prerelease versions. * Updated logic to determine if the GitHub version is greater than or equal to the Gallery version.
* Changed `ModuleVersion` from `2.0.0-beta1` to `2.0.0` in `Plaster.psd1`. * Removed version comparison logic from the publish workflow to streamline the publishing process.
Plaster v2.0.0-alpha uses the null-coalescing operator (`??`) introduced
in PowerShell 7.0, breaking compatibility with PowerShell 5.1 as
specified in the module manifest.
## Changes
**Write-PlasterLog.ps1**
- Replaced `??` operators with conditional expressions compatible with
PS5.1+
```powershell
# Before
$currentLogLevel = $script:LogLevel ?? 'Information'
$currentLevelValue = $logLevels[$currentLogLevel] ?? 2
# After
$currentLogLevel = if ($null -ne $script:LogLevel) { $script:LogLevel } else { 'Information' }
$currentLevelValue = if ($null -ne $logLevels[$currentLogLevel]) { $logLevels[$currentLogLevel] } else { 2 }
```
**Plaster.psm1**
- Added dot-sourcing for Private and Public function files
- Implemented selective export of public functions only
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `www.powershellgallery.com`
> - Triggering command: `/usr/bin/pwsh pwsh -NoProfile -File ./build.ps1
-Bootstrap` (dns block)
> - Triggering command: `/usr/bin/pwsh pwsh -NoProfile -Command
Register-PSRepository -Default -ErrorAction SilentlyContinue
Get-PSRepository` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/PowerShellOrg/Plaster/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Plaster v2.0.0-alpha broken on Windows</issue_title>
> <issue_description>Hiya,
>
> [Sampler]() uses Plaster and we've noticed on our pipelines that the
prerelease version breaks on windows because `Write-PlasterLog` uses the
Null-coalescing operator.
>
>
https://github.com/PowerShellOrg/Plaster/blob/v2/Plaster/Private/Write-PlasterLog.ps1#L52-L54
>
> Could you please fix soonish, or would you recommend we pin an old
version?</issue_description>
>
> <agent_instructions>Search for any use of null coalescing and remove
it. This module must be able to run PS5.1</agent_instructions>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes #442
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com>
Co-authored-by: Gilbert Sanchez <me@gilbertsanchez.com>
* PowerShell doesn't support '.' in prerelease. * Corrected the prerelease version format in the module manifest. * Updated changelog to reflect the new versioning style.
The JSON conditional evaluation on the PLASTER_Options variable always evaluates to false in the PowerShell gallery v2.0 version of Plaster. I provided a fix for the issue. You by no means have to merge this. I just wanted to show you where the problem with JSON templates was happening. It is working great now and I am extremely excited to see that this has been updated, and JSON manifest and templating are great.
The example.com URL failed Register-PSRepository URI validation on GitHub-hosted runners, breaking the publish workflow. Nothing in the build consumed the repo — PSDepend pulls from PSGallery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Overview
This PR lands the long-running
v2branch intomaster, shipping Plaster 2.0.0-alpha1. It's a large drop (~50 commits, ~115 files, +11.5k / -3.2k) and touches nearly every part of the project, so the sections below break it down by theme rather than by commit.Target version:
Plaster.psd1→ModuleVersion = '2.0.0',Prerelease = 'alpha1'.Highlights
plaster-manifest-v2.jsonschema, bidirectional conversion, and validation.Invoke-Plaster.ps1/NewPlasterManifest.ps1/GetModuleExtension.ps1files have been decomposed into per-functionPublic/andPrivate/files.-Bootstrapswitch for clean CI installs.What changed
Module architecture
Plaster/InvokePlaster.ps1(1500+ lines),Plaster/NewPlasterManifest.ps1, andPlaster/GetModuleExtension.ps1into discretePublic/andPrivate/function files.Plaster/Private/helpers for things that were previously inline:ConvertFrom-JsonManifest,ConvertTo-JsonManifest,ConvertFrom-JsonContentAction,ConvertTo-JsonContentAction,Copy-FileWithConflictDetection,Expand-FileSourceSpec,Get-ManifestsUnderPath,Get-PlasterManifestType,Initialize-PredefinedVariables,Invoke-ExpressionImpl,Invoke-PlasterOperation,New-ConstrainedRunspace,Resolve-ModuleVersionString,Resolve-ProcessParameter,Start-Process*,Write-PlasterLog, and friends.Plaster.psm1/Plaster.psd1updated to match the new layout.JSON manifest support (new)
Plaster/Schema/plaster-manifest-v2.json— full JSON Schema for v2 manifests.ConvertFrom-JsonManifest,ConvertTo-JsonManifest, plus content-action variants.Get-PlasterManifestTypedetects XML vs JSON manifests;Test-PlasterManifestvalidates both.examples/(plasterManifest.json,plasterManifest-validatePattern.json,plasterManifest_fr-FR.json).Cross-platform / PS7
DefaulttoUTF-8-NoBOM.Tests
Get-ModuleExtension.Tests.ps1,Get-PlasterManifestPathForCulture.Tests.ps1,Initialize-PredefinedVariables.Tests.ps1,Resolve-ModuleVersionString.Tests.ps1,New-PlasterManifest.Tests.ps1, etc.Help.tests.ps1,Manifest.tests.ps1,Meta.tests.ps1,MetaFixers.psm1(imported from Stucco).tests/Fixtures/ModuleList.xml).Build & tooling
build.ps1refactored for cleaner parameter handling, with-Task,-Bootstrap, and-Helpparameter sets.-Bootstrapprovisions PSDepend (pinned to PowerShellGet v2), then runs a try-import-first-then-install pattern againstrequirements.psd1.requirements.psd1pins PSDepend 0.3.8, Pester 5.7.1, psake 4.9.1, BuildHelpers 2.0.16, PowerShellBuild 0.7.2, PSScriptAnalyzer 1.24.0.psakeFile.ps1delegates to PowerShellBuild;CopyDirectoriesconfigured foren-US,Schema,Templates.debugHarness.ps1refactored for the new module layout..vscode/tasks + settings refreshed;.markdownlint.json+cspell.jsonadded.CI / publish workflow
.github/workflows/publish.yamlnow runs onwindows-latest, usesModuleFast-actionto pre-stage deps, and invokes./build.ps1 -Task Publish -Bootstrap..github/workflows/PesterReports.ymlupdated permissions and action versions.Docs
Breaking changes
UTF-8-NoBOM.Test plan
v2(publish workflow dry-run + Pester reports)🤖 Generated with Claude Code