Created
April 2, 2021 06:30
-
-
Save stefango/80015600d7591b2d2152c5de5b7ed5bb to your computer and use it in GitHub Desktop.
delete.psl
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
# delete empty folders | |
$tdc="DIRECTORY" | |
do { | |
$dirs = gci $tdc -directory -recurse | Where { (gci $_.fullName -Force).count -eq 0 } | select -expandproperty FullName | |
$dirs | Foreach-Object { Remove-Item $_ } | |
$count = $count + 1 | |
} while ($dirs.count -gt 0) | |
echo 'empty folders deleted' | |
# delete files in specific format | |
rm -Force "\FileStorage\File\*\*.gif" | |
rm -Force "\Downloads\*.license" | |
# delete log | |
rm -Force "\Downloads\*downLog*" | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment