compact report output

This commit is contained in:
2026-10-22 17:10:16 -04:00
parent e9fcc2f33b
commit ec9141d062
4 changed files with 139 additions and 45 deletions
+25 -7
View File
@@ -30,8 +30,9 @@ use. The core does not need to download Tools.ps1 itself.
Run once with `CleanupReportOnly=true`, then set it to `false` to apply. Report
mode assesses **all categories regardless of their enablement**, using the current
retention settings. It leaves the enablement variables unchanged. The final report
has three sections:
retention settings. It leaves the enablement variables unchanged. The compact
report starts with the unique enabled savings and additional disabled savings,
then lists every category once in three sections:
- **Enabled:** eligible for cleanup on an apply run, subject to the reported conditions.
- **Disabled:** potential savings only; these categories will not run during apply
@@ -48,16 +49,31 @@ These category estimates can overlap (for example, a duplicate downloaded EXE).
The enabled total counts each file path once. The disabled total shows additional
unique file bytes beyond those already counted in enabled categories. Native
operations such as Disk Cleanup, VSS, Search compaction, Delivery Optimization,
component cleanup, and disabling hibernation say **not estimated**, not zero.
Disk Cleanup also lists its preset (or custom list), expanded selected handlers,
and unselected handlers without running them. `None` places Disk Cleanup in the
Disabled section; the report still lists the unselected handlers. Servers always
place it in the Blocked section, regardless of the preset.
component cleanup, and disabling hibernation show `-` and **not estimated**, not
zero. Disk Cleanup shows its preset (or Custom) and selected handler count.
`None` places Disk Cleanup in the Disabled section. Servers always place it in
the Blocked section, regardless of the preset.
Skipped/unavailable categories say **not assessed**; failed or partially assessed
categories are labeled incomplete. In-use application checks remain enforced, so
close those applications and rerun to obtain their estimates. Unknown savings are
excluded from the totals, and file sizes do not guarantee physical space savings.
The default output is designed for Syncro's limited script output: one line per
category, including zero results, without a second PowerShell object dump or
per-category progress chatter. Column sizes are in MiB; positive sizes below
0.01 MiB display as `<0.01`. The group identifies whether a category is enabled;
its variable is `Cleanup<Category>`, except Disk Cleanup uses
`CleanupDiskCleanupItems`. Skip, failure, and partial-assessment reasons remain
visible. Long diagnostic notes are shortened to one line.
To troubleshoot, set `$VerbosePreference = 'Continue'` in the caller before
`Run-Script`. Verbose output includes progress, full diagnostic notes, and the
selected/unselected Disk Cleanup handler lists; it can exceed Syncro's output
limit, so use a local PowerShell capture when full detail is needed. No additional
Syncro variable is required. The `Invoke-SystemCleanup` function still returns
structured results for programmatic callers; the script entry suppresses their
automatic formatting after printing the human-readable report.
Report mode does not delete files, change registry settings, stop services,
launch maintenance programs, or request scheduled maintenance. Acquiring a named
mutex prevents overlapping runs; the RMM bootstrap still downloads Tools/core
@@ -213,6 +229,8 @@ Coverage includes disabled-category estimates, separate report groups, unique
totals for overlapping categories, and disabled categories remaining untouched in
apply mode. Preset tests verify exact handler membership, cumulative selections,
RMM scope preservation, None disabling native work, and the server exclusions.
Output tests cover the duplicate-object regression, a 22-category preview under
4 KiB, separate enabled/disabled sections, and preservation of diagnostic notes.
References: [OS ProductType](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-operatingsystem),
[Disk Cleanup](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cleanmgr),