Zip all files in folder older than date
✓ Published0🌍 Public
TTomStanczyk
Last edited Jun 21, 2020
Created on Jun 21, 2020
This example demonstrates a PowerShell script that archives files and folders older than a specified date by month. It processes items in an input directory matching a file mask, copying those created before the first day of the given month and year into monthly subdirectories, then compressing each into a separate ZIP archive. The script uses the `Get-ChildItem` cmdlet with the `-Include` parameter, `Copy-Item` with `-Recurse`, and the `Compress-Archive` cmdlet, writing progress to the console via `Write-Host`.
AI-generated description