I used Find-Item
to get the items on my sitecore_master_index
. Now, I want to get the presentation details of each item.
How can I do get each rendering/presentation details?
The output of Find-Item
command is a SearchResultItem
object. You need to call GetItem()
on it first and then you can run commands which will return presentation details. I'm not sure exactly what you want to return but sample code goes as:
$criteria = @(
...
)
$props = @{
Index = "sitecore_master_index"
Criteria = $criteria
}
$searchResultItems = Find-Item @props
foreach ($searchResultItem in $searchResultItems) {
$searchResultItem.GetItem() | Get-Rendering -FinalLayout
}