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?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityThe 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
}