Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Show report of empty folders in Sitecore Media library
$source = Get-Item "master:\media library"
$readonly = $false;
$result =
Read-Variable `
-Parameters @{ Name = "root"; Title="Root folder"; Root="/sitecore/media library"; editor="item"} `
-Title "Find Empty Folders" `
-Description "Select the location you want to inspect." `
-OkButtonName "Clone"
if ($result -eq "ok") {
gci -Path $root.ProviderPath | ? { $_.TemplateName -eq "Media Folder" } | ? { $_.Children.Count -eq 0 } | Show-ListView
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment