4

i've a little problem in powershell with all my cmd output. I have to see on the screen a short cmd result. In the specific this is one of my problem:

cmd

PS C:\C_Directory> ls -Filter *.err|Measure-Object -Line| fw


1

 

As you can see, the Format Wide output it's with more empity lines. How can i transfor this output in :

1

Thanks in advance.

opalenzuela
  • 3,139
  • 21
  • 41
clarkseth
  • 229
  • 4
  • 16
  • Something similar [here](https://stackoverflow.com/q/22311077/465053) which I found to be very helpful. – RBT Jul 13 '17 at 09:02

2 Answers2

5

try this

 ls -Filter *.err|Measure-Object -Line | select -expand lines  
Loïc MICHEL
  • 24,935
  • 9
  • 74
  • 103
4

Jeff Hicks - a PowerShell MVP and more - has made a little filter to solve problems like this. It's called scrub. Hope that helps.

E.V.I.L.
  • 2,120
  • 13
  • 14