Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaellwest/8f4cdf4dc0da0f9d9d46 to your computer and use it in GitHub Desktop.
Save michaellwest/8f4cdf4dc0da0f9d9d46 to your computer and use it in GitHub Desktop.
Count the number of content items excluding certain templates.
# List of template ids to exclude from the count.
$templateIds = @(
"{29FD19B5-6F81-4829-B725-9C4279DA13CE}",
"{C3C9ED41-B476-49A9-B50C-FF8901665EA0}",
"{5A905A62-4898-44CE-96BA-EB3432BAAD91}"
)
@(Get-Item -Path master:\content\home) + @(Get-ChildItem -Path master:\content\home -Recurse) |
Where-Object { $templateIds -notcontains $_.TemplateId } |
Select-Object -Property Name, TemplateId |
Measure-Object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment