Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 10394

How to use select-string without blank lines?

$
0
0

I want to use select-string on the output of another command (similar to how one would use grep on a Unix OS).

Here is the output of the command without the select-string:

> (dir resources).Namewmd-Linux-22022.jsonwmd-Linux-22023.jsonwmd-Linux-22024.jsonwmd-Windows-22022.jsonwmd-Windows-22023.jsonwmd-Windows-22024.json

When I use select-string, I get blank lines for some reason:

> (dir resources).Name | select-string Windowswmd-Windows-22022.jsonwmd-Windows-22023.jsonwmd-Windows-22024.json

How can I either (A) tell select-string to eat the blank lines with no matches, or (B) pipe the output to another powershell utility that could eat the blank lines for me?


Viewing all articles
Browse latest Browse all 10394

Latest Images

Trending Articles



Latest Images