Created
April 15, 2023 18:08
-
-
Save jessewolcott/3ea411ca745730f9b085ea6fd8d8af00 to your computer and use it in GitHub Desktop.
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
$LocalImgFolder = "Path\To\jessewolcott.github.io\assets\img" | |
$Years = (Get-Childitem -Path $LocalImgFolder).Fullname | |
$EmptyFolders = foreach ($Year in $Years){ | |
Remove-Item -Path ((Get-ChildItem -Path $Year -Recurse | Where-Object {($_.PSIsContainer -eq $True) -and ($_.GetFiles().Count -eq 0)}).FullName) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment