With this powershell command you will be to get a unique list of components used on pages.
Import-Function -Name ConvertTo-Xlsx
$allRendering = Get-ChildItem -Path "master:\layout\Renderings" -Recurse |
Where-Object { $_.TemplateName -like "*rendering*"} |
Select-Object Name, ID, TemplateName, Cacheable |
Sort-Object -Property Name
$rootPath = 'master:/sitecore/content/Home'
$itemsToProcess = Get-ChildItem -Path $rootPath -Recurse
$lists = @()
foreach($item in $itemsToProcess)
{
$itemRenderings = Get-Rendering -Item $item -FinalLayout
foreach($itemRendering in $itemRenderings){
$renderingItem = $allRendering | Where-Object { $_.ID -eq $itemRendering.ItemID }
$value = "0"
foreach($list in $lists)
{
if($list -eq $renderingItem.Name)
{
$value = "1"
# write-host $list + "Value is 1"
}
}
if($value -eq "0")
{
if($renderingItem -ne $null)
{
write-host $renderingItem.Name
$lists += $renderingItem.Name
}
}
# write-host $renderingItem.Name
}
}