Skip to content

Latest commit

 

History

History
81 lines (63 loc) · 3.74 KB

File metadata and controls

81 lines (63 loc) · 3.74 KB

Testing Checklist — Temp Cleaner v2.0

I can't execute PowerShell in the environment this script was written in, so none of the boxes below are pre-checked — this is a manual checklist for you to work through on a real Windows machine before treating the script as release-ready.

Core Scenarios

  • Normal user (non-admin) Run without elevation. Confirm Windows Temp and Prefetch/Windows Update Cache (if enabled) are correctly reported as "Skipped (Administrator required)", while User Temp and Recent Items still clean normally.

  • Administrator Run elevated (Run as Administrator). Confirm Windows Temp, Prefetch, and Windows Update Cache all attempt cleanup instead of being skipped.

  • Empty Temp folder Manually empty %TEMP% first, then run. Confirm it reports 0 found, 0 deleted, 100% cleaned, and "Cleaned successfully."

  • Locked files present Open a file from Temp in another program (e.g. open a log file in Notepad) so it can't be deleted, then run. Confirm: - That one file is skipped, not the whole folder - Remaining reflects the locked file - Errors and the exception-type breakdown show up correctly - The rest of the folder still gets cleaned

  • Missing folder Point -FolderPath at a path that doesn't exist (temporarily edit the script or test in isolation) and confirm "Folder Status : Not Found" and Status = "Folder Not Found" without throwing an unhandled error.

  • Verbose mode Run with -VerboseOutput and confirm per-item Deleted : / Skipped : lines appear during cleanup.

  • Auto mode Run with -Auto (and separately -SkipPrompt) and confirm the Y/N prompt is skipped and cleanup starts immediately.

  • Log generation After a run, confirm a new cleanup-yyyy-MM-dd-HH-mm.txt file is created next to the script, contains the full report (per-location detail, summary, error breakdown if any, footer), and that previous runs' log files are still present (not overwritten).

Optional Locations

  • -IncludePrefetch — run elevated, confirm Prefetch is cleaned and skipped correctly when not elevated.
  • -IncludeRecent — confirm Recent Items cleans without requiring admin.
  • -IncludeWindowsUpdateCache — run elevated; note that some files may be locked by the Windows Update service unless wuauserv is stopped first.
  • -IncludeRecycleBin — confirm the Recycle Bin empties, and that the script degrades gracefully (reports a skipped/failed status rather than crashing) if the Recycle Bin COM object is unavailable in a given environment.

Reporting Accuracy

  • Files Deleted + Folders Deleted matches the console/log "Deleted" count for each location.
  • Total Size Freed looks plausible against actual disk space freed (spot-check with folder Properties before/after).
  • Overall Status shows SUCCESS only when remaining = 0 and errors = 0 across all cleaned locations; otherwise COMPLETED WITH WARNINGS.

Command-Line / Help

  • .\TempCleaner.ps1 -Version prints version info and exits without cleaning.
  • .\TempCleaner.ps1 -? or Get-Help .\TempCleaner.ps1 -Full shows the comment-based help correctly (Synopsis, Description, all Parameters, Examples).

Known Limitations to Confirm You're OK With

  • Recycle Bin SizeFreed is always reported as 0 (documented limitation, not a bug) — confirm this is acceptable or flag if you want it addressed.
  • Script has not been tested against PowerShell 7 specifically — only written against Windows PowerShell 5.1 conventions. Worth a pass if you run PS7 regularly.