How to count multiple lines from git log in PowerShell? <p><strong>PROBLEM</strong> </p> <pre><code>git log --pretty=oneline $branch...$version </code></pre> <p>Allows me to determine how many commits are between the specified branch and tag. Each commit is printed to the console window on a different line, and starts with 40 characters of that commit's SHA and is followed by a brief description.</p> <p>Using PowerShell, I would like to take the count of all these commits and assign it to a variable. I don't want to output this data to a file.</p> <p>My assumption is that a large regex would be the best option, but I'm thinking that there must be an easier solution.</p> <p><strong>QUESTION</strong><br> Is there an easier way to find the count of multiple lines outputted to the console? </p> <p>Also, is there a way to get around the buffer size when handling the log data without adjusting the buffer-size of the console window? Or is this a factor I will need to worry about at all? (<em>when handling a large amount of commits</em>)</p>