Overview
Built a suite of PowerShell tools for managing document lifecycle policies in SharePoint Online. Handles age-based file archival, version history cleanup, and storage optimization across large document libraries - all with dry-run modes for safe preview before execution.
Key Features
- File archival based on document age or last accessed date
- Configurable age threshold (years) with interactive site and library selection
- Complete folder hierarchy preservation during moves between libraries
- Version history cleanup to reclaim storage from excessive file versions
- Dry-run mode for safe preview of all operations before committing
- Test limit mode to validate moves on a small batch before full execution
- Detailed logging with timestamps, file sizes, and error CSV export
- Progress bars with file counting for large library operations
Technical Highlights
- PnP.PowerShell module with certificate-based authentication
- Server-relative URL path calculation for cross-library moves
- Automatic destination folder creation via Resolve-PnPFolder
- Per-file error tracking with structured error export
- File size formatting (GB/MB/KB) for storage impact reporting
- Multiple archival strategies: by creation date, last modified, and last accessed
- Graph API variant for version cleanup operations