Created
May 13, 2021 07:29
-
-
Save AdamNaj/bf0d4928602726e19e9dacffc46db95d to your computer and use it in GitHub Desktop.
Show report of empty folders in Sitecore Media library
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
$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