diff --git a/CHANGELOG.md b/CHANGELOG.md index 5473a97..9affe34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [2.0.0] 2025-06-18 +## [2.0.0-alpha.1] 2026-02-12 + +### Fixed + +- Null-coalescing operators replaced with PS5.1-compatible syntax in + Write-PlasterLog to fix PowerShell 5.1 compatibility + ([#442](https://github.com/PowerShellOrg/Plaster/issues/442)) + +## [2.0.0-alpha] 2025-06-18 ### Added diff --git a/Plaster/Plaster.psd1 b/Plaster/Plaster.psd1 index 0e40228..8b5932c 100644 --- a/Plaster/Plaster.psd1 +++ b/Plaster/Plaster.psd1 @@ -15,7 +15,7 @@ # PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ - Prerelease = 'alpha' + Prerelease = 'alpha.1' # Tags applied to this module. These help with module discovery in online galleries. Tags = @('Plaster', 'CodeGenerator', 'Scaffold', 'Template', 'JSON', 'PowerShell7') diff --git a/Plaster/Private/Write-PlasterLog.ps1 b/Plaster/Private/Write-PlasterLog.ps1 index 39d337c..d4ea57b 100644 --- a/Plaster/Private/Write-PlasterLog.ps1 +++ b/Plaster/Private/Write-PlasterLog.ps1 @@ -49,9 +49,9 @@ function Write-PlasterLog { 'Debug' = 4 } - $currentLogLevel = $script:LogLevel ?? 'Information' - $currentLevelValue = $logLevels[$currentLogLevel] ?? 2 - $messageLevelValue = $logLevels[$Level] ?? 2 + $currentLogLevel = if ($null -ne $script:LogLevel) { $script:LogLevel } else { 'Information' } + $currentLevelValue = if ($null -ne $logLevels[$currentLogLevel]) { $logLevels[$currentLogLevel] } else { 2 } + $messageLevelValue = if ($null -ne $logLevels[$Level]) { $logLevels[$Level] } else { 2 } if ($messageLevelValue -gt $currentLevelValue) { return diff --git a/tests/Manifest.tests.ps1 b/tests/Manifest.tests.ps1 index 4792558..6d6ae56 100644 --- a/tests/Manifest.tests.ps1 +++ b/tests/Manifest.tests.ps1 @@ -4,8 +4,10 @@ BeforeAll { . $path -Task Build } # NEW: Pre-Specify RegEx Matching Patterns - $gitTagMatchRegEx = 'tag:\s?.(\d+(\.\d+)*)' # NOTE - was 'tag:\s*(\d+(?:\.\d+)*)' previously - $changelogTagMatchRegEx = "^##\s\[(?(\d+\.){1,3}\d+)\]" + # Matches semantic versioning with optional pre-release and build metadata + # Examples: 1.0.0, 2.0.0-alpha, 2.0.0-alpha.1, 2.0.0+build.123 + $gitTagMatchRegEx = 'tag:\s?.(\d+(?:\.\d+)*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?' + $changelogTagMatchRegEx = "^##\s\[(?(\d+\.){2}\d+)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\]" $moduleName = $env:BHProjectName $manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest