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.

1
  • Something similar here which I found to be very helpful. Commented Jul 13, 2017 at 9:02

2 Answers 2

5

try this

 ls -Filter *.err|Measure-Object -Line | select -expand lines  
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.