DEV Community

Cover image for XML Tag Counter: A PowerShell Script That Saved Me Hours (And Can Save You Too!)
Spiros Vatikiotis
Spiros Vatikiotis

Posted on

XML Tag Counter: A PowerShell Script That Saved Me Hours (And Can Save You Too!)

I needed to count tags across 200+ XML files containing thousands and thousands of rows. Opening each file and searching manually would take hours. So I built a PowerShell script to do it.
XML Tag Counter scans a directory, counts occurrences of a specific XML tag across all XML files, and gives you totals plus a per-file breakdown.

It handles namespaces, supports multiple file extensions, and shows progress for large batches.

I use it for data migrations, compliance checks, and debugging. It’s saved me a lot of time.

It scans recursively, handles namespaces, and shows progress. No configuration needed.

This is a starting point, and I’d love your help. Found a bug? Have an idea? Want to improve docs or performance? Every contribution helps, whether it’s a small fix or a new feature.

If this script saves you time, consider contributing. Don't forget to tell me what you think after you try it!

Check it out: GitHub Repository

Happy coding ya all!

S.V

Top comments (0)