I'm writing a Sitecore PowerShell script to get all images (without their Media Folders) under the path master:\sitecore\media library
, where the File Path
in the Media
section is empty, like the following image
This is my code
$path = "master:\sitecore\media library"
$items = Get-ChildItem -Path $path -Recurse | Where-Object { $_.TemplateID -ne [Sitecore.TemplateIDs]::MediaFolder }
$items | ForEach-Object {
Write-Host "Item name: " $_.Name
}
I need to add another condition to get all images with empty file path but I don't know how to do it, I'm a newbie with Sitecore.
I use Sitecore 8.2