diff --git a/Header.ps1 b/Header.ps1 index d2f4a39..add4b85 100644 --- a/Header.ps1 +++ b/Header.ps1 @@ -3,7 +3,7 @@ RackStack - All-in-one Windows Server setup utility (Monolithic Build). .DESCRIPTION - This is the MONOLITHIC BUILD -- all 78 modules combined into a single file. + This is the MONOLITHIC BUILD -- all 81 modules combined into a single file. Generated by sync-to-monolithic.ps1 from the modular source in Modules/. The .exe is compiled from this file via ps2exe. diff --git a/README.md b/README.md index 680db49..fcba1e0 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ OpenSSF Best Practices codecov PSScriptAnalyzer 0 errors - 5493 structural tests + 5495 structural tests Pester 312 tests SLSA Level 3

diff --git a/Tests/Run-Tests.ps1 b/Tests/Run-Tests.ps1 index ff9c59a..77d3ac5 100644 --- a/Tests/Run-Tests.ps1 +++ b/Tests/Run-Tests.ps1 @@ -10651,6 +10651,24 @@ try { # README test badge label is the specific 'structural tests' (distinct from the Pester badge). Write-TestResult "DocFreshness: README test badge uses a specific label" ($readmeRaw -match 'structural%20tests|structural tests') + + # Header.ps1's .DESCRIPTION states the module count, and it is the text that + # lands at the top of the shipped monolithic and therefore inside the EXE. + # It was NOT covered here and rotted to "all 78 modules" against a live 81. + # + # Scope matters: everything from the first .CHANGELOG onward is version + # history, where "64 modules, 1873 tests" is a true statement about v1.20.4. + # Asserting over the whole file would demand falsifying that history, so only + # the current-tense preamble is checked. + $headerRaw = Get-Content (Join-Path $script:ModuleRoot 'Header.ps1') -Raw + $firstChangelog = $headerRaw.IndexOf('.CHANGELOG') + $headerPreamble = if ($firstChangelog -gt 0) { $headerRaw.Substring(0, $firstChangelog) } else { $headerRaw } + Write-TestResult "DocFreshness: Header.ps1 preamble is separable from its changelog" ` + ($firstChangelog -gt 0) "no .CHANGELOG found — the check below would scan version history" + $hdrMod = @([regex]::Matches($headerPreamble, '(\d{2,4})\s+modules\b')) + $hdrStale = @($hdrMod | Where-Object { [int]$_.Groups[1].Value -ne $liveModuleCount }) + Write-TestResult "DocFreshness: Header.ps1 module count == $liveModuleCount" ` + ($hdrStale.Count -eq 0) $(if ($hdrStale.Count) { "stale: $(($hdrStale | ForEach-Object { $_.Value }) -join ', ')" } else { "" }) } catch { Write-TestResult "Documentation Freshness Tests" $false $_.Exception.Message