Last active
December 10, 2022 07:41
-
-
Save lzehrung/23688712b3653b8cde0640ffc87ee04d to your computer and use it in GitHub Desktop.
Find all child files modified in the last day and remove them (ignoring errors and confirm prompts)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Recurse -Filter *.csv | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-1)} | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment