guimatheus92 / Delete-Files-from-Folder

With this PowerShell script you can delete files from folder within a certain time period

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delete files from folder older than any days

With this PowerShell script you can delete files from folder within a certain time period.

You just have to define how many days you want to filter to delete files on the line below.

# Defines how many days the files can stay in the defined directory
$limit = (Get-Date).AddDays(-7)

You also need to paste the folder path where the files are located on the line below.

# Defines the destination directory to clean files
$path = "Put your folder path here"

About

With this PowerShell script you can delete files from folder within a certain time period


Languages

Language:PowerShell 100.0%