0

When I use the command

Get-Content $file | Measure-Object –Line

the result is

Lines Words Characters Property
----- ----- ---------- --------
  516   

but I only need the lines in my output, how can I assign the line value to a variable?

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
drifter213
  • 109
  • 1
  • 12

1 Answers1

3
$lines = (Get-Content $file | Measure-Object -Line).Lines
David Brabant
  • 41,623
  • 16
  • 83
  • 111