I need to find media items that has no references, but user should have an option to delete them manually . by some reason, if I add an item to custom noRefeItems, Show-ListView component does not show delete action. how to fix it?
$noRefeItems = [System.Collections.ArrayList]@()
$itemsToProcess = Get-ChildItem -Path $root.ProviderPath -Recurse | Where-Object { $_.TemplateName -eq 'Image' }
if ($itemsToProcess -ne $null) {
$itemsToProcess | ForEach-Object {
$referrers = Get-ItemReferrer -Item $_ | measure
if ($referrers.Count -gt 0) {
} else {
$noRefeItems.Add($_)
}
}
}
$noRefeItems | Show-ListView -Property DisplayName, ProviderPath, Size, Created