2

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?

5

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
}
  • I tried running your sample code and the result is exactly what I'm looking. Thank you so much. – eudaimonia_ Mar 29 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.