Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Count the number of content items excluding certain templates.
# List of template ids to exclude from the count.
$templateIds = @(
@(Get-Item -Path master:\content\home) + @(Get-ChildItem -Path master:\content\home -Recurse) |
Where-Object { $templateIds -notcontains $_.TemplateId } |
Select-Object -Property Name, TemplateId |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment