Below is one of the ways to get the number of lines from a file:
PS > Get-Content -Path "C:\DefaultStartMenu.xml" | Measure-Object -Line Lines Words Characters Property ----- ----- ---------- -------- 20
Use the Get-Content cmdlet to read your file and count the number of lines with the Measure-Object cmdlet. The command and output are shown in the following figure:
Thanks for reading! You can follow me on Twitter @PrigentNico