Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victorwoo/remove-expiredfiles
Remove old files in specific folder.
https://github.com/victorwoo/remove-expiredfiles
Last synced: 4 days ago
JSON representation
Remove old files in specific folder.
- Host: GitHub
- URL: https://github.com/victorwoo/remove-expiredfiles
- Owner: victorwoo
- License: mit
- Created: 2017-07-12T01:28:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-12T01:58:49.000Z (over 7 years ago)
- Last Synced: 2024-11-13T03:35:03.151Z (2 months ago)
- Language: PowerShell
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Remove-ExpiredFiles
清除指定文件夹中过期的文件。## 参数说明
- `$targetDir` 为待清理的目录。
- `$pattern` 为待清理的文件名,支持通配符。
- `$expiryDays` 为过期时间,单位是天。## 计划任务
若要定期执行脚本,请创建计划任务。计划任务的“启动程序”设置如下:
- “程序或脚本”填 powershell
- “添加参数”填 -NoProfile -ExecutionPolicy Unrestricted .\Remove-ExpiredFiles.ps1
- “起始于”填脚本所在的目录