Skip to content

Conversation

@N3M3S1SK41R0S
Copy link

Summary

This PR adds development environment configuration and a comprehensive PowerShell script for managing disk space on the C: drive through inventory, archival, and deduplication operations.

Changes

VS Code Configuration (.vscode/settings.json)

  • Added TypeScript/JavaScript IntelliSense settings for enhanced development experience
  • Enabled type hints for variables, parameters, return types, and enum members
  • Configured TypeScript server logging and diagnostics for better debugging

C: Drive Cleanup Script (Script/cleanup_full_C_execute.ps1)

A production-ready PowerShell script that performs comprehensive disk management:

Core Features:

  • Single-pass inventory scan of C: drive (excluding system directories) generating CSV reports
  • Duplicate detection using SHA256 hashing with size-based pre-filtering for performance
  • Automated operations:
    • Move large root directories to D: using robocopy
    • Archive old files (>2 years by default) to E: in 7z format
    • Quarantine duplicate files to E: with retention policies
  • Safety mechanisms:
    • Dry-run mode (-DryRun) for planning without execution
    • Comprehensive logging and transcription
    • Space availability checks before operations
    • Critical directory protection (Users, Windows, Program Files, etc.)
    • Configurable parameters for thresholds and retention

Key Implementation Details:

  • Requires Administrator privileges and PowerShell 5.1+
  • Generates detailed CSV reports for audit and review
  • Uses robocopy for efficient directory moves with multi-threading
  • Implements proper error handling and progress tracking
  • Supports 7-Zip integration for compression (optional)
  • Maintains operation statistics and summary reporting

Parameters:

  • -DryRun: Simulation mode without file operations
  • -TopN: Number of largest files to report (default: 100)
  • -MinSizeMBToConsider: Minimum size threshold (default: 50 MB)
  • -OldYearsThreshold: Age threshold for archival (default: 2 years)
  • -KeepCopies: Duplicate copies to retain (default: 2)
  • -RetentionDaysQuarantine: Quarantine retention period (default: 30 days)
  • -SkipHash: Disable duplicate detection for speed
  • -Force: Skip interactive confirmations

All operations are logged to C:\Temp\RapportsNettoyage\ with detailed reports and transcripts for compliance and troubleshooting.

https://claude.ai/code/session_01W4G9Qd8TxnszYZ9Wb7SWGu

N3M3S1SK41R0S and others added 5 commits October 1, 2025 12:13
…ance fixes

Major improvements over original script:
- Single recursive scan of C: instead of 3 separate scans
- Optimized duplicate detection: pre-filter by file size before hashing
- Replace O(n²) array concatenation with Generic.List collections
- Add CmdletBinding with -DryRun, -SkipHash, -Force parameters
- Add drive space checks before all operations
- Protect critical directories (C:\Users, etc.) from accidental moves
- Preserve relative paths in quarantine to prevent name collisions
- Add robocopy exit code validation
- Add progress bars for long operations
- Add transcript logging for full audit trail
- Add execution summary with statistics
- Wrap everything in try/catch/finally for safe error handling
- Require admin and PowerShell 5.1+

https://claude.ai/code/session_01W4G9Qd8TxnszYZ9Wb7SWGu
Phase-based cleanup engine (0-6) with configuration for target
directory tree, service optimization list, and purge patterns.
Root-level entry point alongside the detailed Script/ version.

https://claude.ai/code/session_01W4G9Qd8TxnszYZ9Wb7SWGu
Complete 7-phase system cleanup engine:
- Phase 0: System snapshot (OS, disks, apps, startup, directory tree)
- Phase 1: Disk audit (top dirs/files, cache analysis, Docker, dupes)
- Phase 2: RAM optimization (processes, startup, services, visual FX)
- Phase 3: File reorganization (target tree, downloads, temp, junk)
- Phase 4: Desktop cleanup (5 shortcuts, hide system icons)
- Phase 5: Empty directory purge (multi-pass with exclusions)
- Phase 6: System optimizations (cleanmgr, DISM, WU, TRIM, Docker)

https://claude.ai/code/session_01W4G9Qd8TxnszYZ9Wb7SWGu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants