Add scripts
This commit is contained in:
parent
422934aef7
commit
350807c951
30 changed files with 574 additions and 0 deletions
8
Scripts/Clear-env-Temp-14-days.ps1
Normal file
8
Scripts/Clear-env-Temp-14-days.ps1
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
$ls = Get-Item $env:TEMP\*.tmp # or your path and file extension
|
||||
$date = (Get-Date).AddDays(-14)
|
||||
foreach ($l in $ls) {
|
||||
if ($l.LastWriteTime -le $date) {
|
||||
$l.FullName
|
||||
Remove-Item $l.FullName -Recurse
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue