Created
April 20, 2016 13:32
-
-
Save AdamNaj/035366c698ef98e1b00a574eb085e790 to your computer and use it in GitHub Desktop.
Template Complexity analysis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$standardFieldCount = (Get-ItemTemplate master:\).Fields.Count | |
Get-ChildItem master:\templates -Recurse | | |
? {($_.TemplateName -eq "Template") -and -not $_.FullPath.StartsWith('/sitecore/templates/System')} | | |
% { [Sitecore.Data.Items.TemplateItem]$template = $_ | |
[pscustomobject]@{ | |
Path=&{$_.FullPath}; | |
OnThisTemplate=&{(Get-ChildItem -Path $_.Providerpath -Recurse | ? { $_.TemplateName -eq "Template Field"}).Count}; | |
NonStandardFields =&{$template.Fields.Count- $standardFieldCount}; | |
TotalFields=&{$template.Fields.Count} | |
} | |
} | | |
Sort-Object NonStandardFields -descending | | |
? { $_.NonStandardFields -gt 10 } | | |
Format-Table -auto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment