From 17cb9b16b32a546731e3964de16823f1891289bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Eizedev?= <6794362+eizedev@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:01:51 +0100 Subject: [PATCH 1/2] fix(build): keep typographic single quotes in release notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update-ModuleManifest doubles ' in the single-quoted ReleaseNotes string but not U+2018..U+201B, which PowerShell also reads as single quotes. The Pivot.Demo 0.7.0 notes contain `O’Neil`, so the built manifest was invalid and the release stopped in its prepare step. Double those characters before the call; each stays one character in the manifest. Co-Authored-By: Claude Opus 5.5 --- build/Publish-Module.ps1 | 7 +++++-- tests/powershell/Publish-Module.Tests.ps1 | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/build/Publish-Module.ps1 b/build/Publish-Module.ps1 index 4ddcfe3..3291793 100644 --- a/build/Publish-Module.ps1 +++ b/build/Publish-Module.ps1 @@ -77,8 +77,11 @@ if (-not $match.Success -or -not $match.Groups['notes'].Value.Trim()) { $notes = ($match.Groups['notes'].Value -replace '(?m)^\[[^\]]+\]:\s*\S+\s*$', '').Trim() # the built manifest carries the notes (the gallery shows them); the source keeps its link. -# Update-ModuleManifest writes them safely (quotes, several lines) and can run again. -Update-ModuleManifest -Path $manifestPath -ReleaseNotes $notes +# Update-ModuleManifest writes them safely (quotes, several lines) and can run again. It doubles ' in +# its single-quoted string but not the typographic single quotes ‘ ’ ‚ ‛, which PowerShell reads as +# quotes too; doubled, each stays one character. +$manifestNotes = $notes -replace '([‘’‚‛])', '$1$1' +Update-ModuleManifest -Path $manifestPath -ReleaseNotes $manifestNotes # the GitHub release takes the same text and names where the module is installed from $releaseNotes = "{0}`n`nIn the PowerShell Gallery: {1}" -f $notes, ($galleryPackageUrl -f $Module, $Version) Set-Content -LiteralPath (Join-Path $OutputPath "$Module-$Version.notes.md") -Value $releaseNotes -Encoding utf8NoBOM diff --git a/tests/powershell/Publish-Module.Tests.ps1 b/tests/powershell/Publish-Module.Tests.ps1 index 2dcf122..76ec7cc 100644 --- a/tests/powershell/Publish-Module.Tests.ps1 +++ b/tests/powershell/Publish-Module.Tests.ps1 @@ -68,4 +68,17 @@ Describe 'Publish-Module.ps1 release notes' { } finally { Remove-Item -LiteralPath $root -Recurse -Force } } + It 'keeps typographic single quotes, which PowerShell also reads as quotes' { + $q = [char]0x2019 + $root = Initialize-ReleaseFixture "## [1.2.3]`n`n- A folder of ``O${q}Neil`` and ${q}quoted${q}.`n" + try { + $script = Join-Path $root 'build' 'Publish-Module.ps1' + & $script -Module Demo.Module -Version 1.2.3 6>$null | Out-Null + & $script -Module Demo.Module -Version 1.2.3 6>$null | Out-Null + $notes = (Import-PowerShellDataFile (Join-Path $root 'output' 'Demo.Module' '1.2.3' 'Demo.Module.psd1')).PrivateData.PSData.ReleaseNotes + $notes | Should -BeExactly "- A folder of ``O${q}Neil`` and ${q}quoted${q}." + (Get-Content (Join-Path $root 'output' 'Demo.Module-1.2.3.notes.md') -Raw) | Should -BeLike "*O${q}Neil*" + } + finally { Remove-Item -LiteralPath $root -Recurse -Force } + } } From 2ad9049b4507b4232f5d769ed53325d7fdcdd78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Eizedev?= <6794362+eizedev@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:09:26 +0100 Subject: [PATCH 2/2] fix(build): keep Publish-Module.ps1 ASCII Co-Authored-By: Claude Opus 5.5 --- build/Publish-Module.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Publish-Module.ps1 b/build/Publish-Module.ps1 index 3291793..cce9d76 100644 --- a/build/Publish-Module.ps1 +++ b/build/Publish-Module.ps1 @@ -78,9 +78,9 @@ $notes = ($match.Groups['notes'].Value -replace '(?m)^\[[^\]]+\]:\s*\S+\s*$', '' # the built manifest carries the notes (the gallery shows them); the source keeps its link. # Update-ModuleManifest writes them safely (quotes, several lines) and can run again. It doubles ' in -# its single-quoted string but not the typographic single quotes ‘ ’ ‚ ‛, which PowerShell reads as -# quotes too; doubled, each stays one character. -$manifestNotes = $notes -replace '([‘’‚‛])', '$1$1' +# its single-quoted string but not the typographic single quotes U+2018 to U+201B, which PowerShell +# reads as quotes too; doubled, each stays one character. +$manifestNotes = $notes -replace '([\u2018\u2019\u201A\u201B])', '$1$1' Update-ModuleManifest -Path $manifestPath -ReleaseNotes $manifestNotes # the GitHub release takes the same text and names where the module is installed from $releaseNotes = "{0}`n`nIn the PowerShell Gallery: {1}" -f $notes, ($galleryPackageUrl -f $Module, $Version)