Jeremy Stein - Brain
« Can’t e-file NY taxes with H&R Block at Home | filehelper.exe: Could Not establish Connection to AR:OpenARConnection Call Failed. » |
PowerShell script to archive old files
On our development server, I have all emails redirected to the file system. That directory fills up quickly, so I have a scheduled task that runs the following PowerShell hourly:
Get-ChildItem C:\MyPath -Filter "*.eml" | ?{$_.psIsContainer -eq $false -and $_.LastWriteTime -lt (Get-Date).AddHours(-4)} | Move-Item -Destination D:\MyPath\Archive
This moves any email files (*.eml) more than four hours old to the Archive directory.
No Comments
Be the first to comment!
« Can’t e-file NY taxes with H&R Block at Home | filehelper.exe: Could Not establish Connection to AR:OpenARConnection Call Failed. » |
Leave a Reply