PowerShell – Cleaning up old files with Compress-Archive & organizing by date

Windows Management Framework 5.0 introduces a few new Commandlets, notibly Compress-Archive which makes creating a .ZIP from within PowerShell extremely easy.  Below is a small project I worked on this week to clean up an FTP server used by automated processes.

This script grabs all files older than 24 hours, moves them into a folder by day, zips that folder, then deletes the folder.  Included error handling will capture the error and send via SMTP.

Any reccomendations/comments welcomed!