Skip to content

Instantly share code, notes, and snippets.

@AlexKasaku
AlexKasaku / FixBrokenRenderings.ps1
Created November 5, 2020 19:50
Sitecore - Fix broken renderings
#
# Recurses through the content and finds all Renderings used by pages. Used to find any broken renderings.
# Assumes datasources can only be IDs, so setups that use queries can be flagged as incorrect (e.g. in SXA).
#
$rootItem = Get-Item -Path "master:/sitecore/content/website/Home"
$defaultLayout = (Get-LayoutDevice "Default")
# Set to true to only report on issues, rather than address them. If this is false, renderings deemed bad are removed!
$reportOnly = $True