Skip to content

Uses powershell to automatically clean files in a folder that are older than a specific time frame

Notifications You must be signed in to change notification settings

derickdiaz/auto-folder-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Auto-Folder-Cleaner

Powershell Module that contains functions to remove files before a specific day or specific number of days

Examples:

# Removes files that were not modified within the last 30 days
Remove-OldFiles -FilePath "C:\Users\User\Downloads" -Days 30 
# Pipes Folders to check on files based on date created
Get-ChildItem -Directory | Remove-OldFiles -Date (Get-Date).AddDays(-30) -Type CreationTime

Parameters

Name Description
FilePath List of valid filepaths
Day Number of days before the current day (Default = 30)
Date Date Time of the limit before deletion
Type Specified to check either CreationTime or LastWriteTime (Default = LastWriteTime)
DryRun Runs Command without deleting the files
Confirm Prompts User for confirmation before removing directories recursively

About

Uses powershell to automatically clean files in a folder that are older than a specific time frame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published