Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-ChildItem -Recurse -Directory -Path 'D:OlderfilesSourceDocuments' -Filter 'Archive' |
- ForEach-Object {
- Get-ChildItem -File -Path $_.FullName |
- ForEach-Object {
- if ($_.LastWriteTime -lt (Get-Date).AddDays(-120)) {
- Remove-Item -Path $_.FullName -WhatIf
- }
- }
- }
- powershell -NoLogo -NoProfile -File "delold.ps1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement