Skip to content

Instantly share code, notes, and snippets.

@jessewolcott
Created April 15, 2023 18:08
Show Gist options
  • Save jessewolcott/3ea411ca745730f9b085ea6fd8d8af00 to your computer and use it in GitHub Desktop.
Save jessewolcott/3ea411ca745730f9b085ea6fd8d8af00 to your computer and use it in GitHub Desktop.
$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