v6.1.0 - shared library, unified report, scheduler, best-in-class coverage#3
Merged
Conversation
The admin check, WhatIf probe, byte formatter, console+file logger, and the System Restore point routine were copy-pasted into all three engines. Pull them into one dot-sourced WinSenior.Common.ps1 so a fix lands once instead of drifting between three copies. - Each engine dot-sources Common and keeps a 1-line wrapper (Write-*Log, New-*RestorePoint), so every call site is unchanged. - New-WinSeniorRestorePoint returns 'WhatIf'|'Created'|'Failed'; the caller owns its own $script:RestorePointMade flag and logs via a -LogAction block. - WinSenior.ps1 drops its local Test-Admin and uses Test-AdminPrivileges. - CI globs all root *.ps1 for parse + PSScriptAnalyzer instead of a hardcoded 4-file list, so WinSenior.UI.ps1 is finally linted too. - Add tests/WinSenior.Common.Tests.ps1 (Pester 5, mocked restore point). Net -175 duplicated lines across the engines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ller
Part A - unified report. All three engines' -ReportPath now write one envelope
via the new Write-WinSeniorReport helper in Common:
Tool/Version/Engine/Host/Timestamp/Mode/RestorePoint/DurationSec + engine-specific
Summary{} and Items[]. Each Write-*Report shrinks to a single call. Fixes a latent
trap: @() throws 'Argument types do not match' on the Generic.List[object] the
engines pass, so the helper casts via [object[]].
Part B - scheduled-task installer. New dot-sourced WinSenior.Schedule.ps1 with a
pure planner (Get-WinSeniorScheduleSpec) plus Install-/Remove-WinSeniorSchedule.
WinSenior.ps1 gains -InstallSchedule / -RemoveSchedule (fire-and-exit). Registers
a weekly unattended cleanup and a monthly read-only health scan under \WinSenior\,
reports to %ProgramData%\WinSenior\reports. Weekly trigger via the cmdlet; monthly
via the MSFT_TaskMonthlyTrigger CIM class (MonthOfYear is singular and required).
Tests: report round-trip + envelope assertions in Common.Tests; pure-spec coverage
in the new Schedule.Tests. Verified by dot-sourcing under pwsh 7 and PS 5.1 (all
three engines' reports + both trigger builds); live task registration is left to a
real machine. README documents both.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… 49, repair 25) Competitive gap audit vs CCleaner/BleachBit/Wise/Tron, O&O ShutUp10/privacy.sexy/ Win11Debloat/Sophia/WinUtil, and built-in troubleshooters. Every proposed gap was grounded against the live registry first, so already-covered targets were not duplicated. Cleanup 57->63: win-caches, ps-modulecache, rdp-cache, livekernel, srum-db (stops DPS), eventtranscript (stops DiagTrack); extended shadercache (OptixCache/NV_Cache) and windows-old ($WinREAgent). Optimize 29->49: modern Win11 privacy/debloat the tool was missing - Recall & Click-to-Do, Copilot, tailored-ads, Spotlight policy, inking/typing & speech telemetry, CEIP/Appraiser/WER, Delivery-Optimization P2P, OneDrive pre-signin, cloud-clipboard(off); combined taskbar/Start ad-surface debloat, SCOOBE nag, show-file-extensions(off), classic context menu(off), Teredo(off), Fast-Startup(off). All reversible; none touch Defender RTP / Windows Update / Edge / Store. Repair 13->25: restore-enabled, hosts-integrity, proxy/PAC hijack, firewall-state, Defender signatures (update-only), SMBv1, critical scheduled-task health, BITS, print spooler, Store health, plus report-only SSD wear and crash history. Scans are locale-safe (CIM/registry/enums, Get-WinEvent in try/catch) and read-only; Get-AppxPackage wrapped in try/catch for pwsh 7. Tests: 'New coverage' Describe blocks added to all three suites. Verified by dot-sourcing under pwsh 7 and Windows PowerShell 5.1 (registries build, IDs unique, every new repair scan runs without throwing). README counts updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Bump version to 6.1.0 (Get-WinSeniorVersion single source + headers + README badge). - Add CHANGELOG.md (Keep a Changelog) documenting the v6.1.0 work. - Add tools/Build-Release.ps1 (zip + SHA256SUMS, version-driven) and tools/Sign-Scripts.ps1 (Authenticode signing of the root scripts). - .gitignore the per-tool/editor configs (.codex/.cursor/.opencode/.windsurf/.zed, AGENTS.md) and the dist/ build output - they are machine-local, not project files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use a function-local list + GetNewClosure instead of $script: scope: a script-scoped variable read inside the closure resolves to $null across the closure module boundary, which crashed the three New-WinSeniorRestorePoint tests with 'cannot call a method on a null-valued expression'. Verified the closure mechanism locally (WhatIf path) under pwsh 7. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Maintenance-suite upgrade to v6.1.0. Four coherent pieces, each committed separately.
1. Shared library (refactor)
New
WinSenior.Common.ps1dot-sourced by every engine + the menu: admin check, WhatIf probe, byte formatter, canonical logger (Write-WsLog), and the System Restore routine (New-WinSeniorRestorePoint). ~175 duplicated lines removed; public signatures unchanged. CI now globs all root*.ps1for parse + PSScriptAnalyzer (the UI/common/schedule libraries were previously unlinted).2. Unified report + scheduled-task installer
-ReportPathnow writes one envelope viaWrite-WinSeniorReport:Tool/Version/Engine/Host/Timestamp/Mode/RestorePoint/DurationSec+ engine-specificSummary+Items. Breaking for oldclean.json/repair.jsonconsumers (counters moved underSummary).WinSenior.Schedule.ps1+WinSenior.ps1 -InstallSchedule/-RemoveSchedule: weekly unattended cleanup + monthly read-only health scan under\WinSenior\, reports to%ProgramData%\WinSenior\reports.3. Best-in-class coverage (competitive gap audit)
Every proposed gap grounded against the live registry first (no duplicate targets).
$WinREAgent.4. Release tooling
CHANGELOG.md,tools/Build-Release.ps1(zip + SHA256SUMS),tools/Sign-Scripts.ps1; version bumped to 6.1.0; per-tool/editor configs git-ignored.Verification
Dot-sourced under pwsh 7 and Windows PowerShell 5.1: registries build (63/49/25), IDs unique, areas/categories valid, every new repair scan runs without throwing, report round-trips, both schedule triggers build. Pester suites gained "New coverage" blocks. Live task registration / signing / actual release left to the maintainer.
Two latent bugs fixed:
@()throwsArgumentExceptionon theList[object]engines pass (cast[object[]]);Get-AppxPackageraises a terminating load error under pwsh 7 that-EA SilentlyContinuemisses (wrapped in try/catch).🤖 Generated with Claude Code