r/PowerShell • • Jan 06 '26

Question Piping to Select-String does not work

I'm trying to use the following command to diagnose some dependency issues with my nascent C++ project:

 vcpkg depend-info qtbase | Select-String -Pattern "font"

This does literally nothing and I still see the entire output of vcpkg. I also tried piping to rg.exe (RipGrep) and the result is the same. AI failed me so here I come. Please at least point me in the right direction. Hate Powershell. Thanks.

0 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/Atmaks Jan 07 '26

Another commenter pointed out that the issue was that vcpkg was writing to stderr rather than to stdout. Still, thank you for taking the time.

I don't quite see how your (and a few other people) mind went to output devices here. vcpkg is a CLI utility and is supposed to print its output back to the terminal, meaning stdout. Where else would it write? Or did you mean something else?

1

u/vermyx Jan 07 '26

vcpkg is a CLI utility and is supposed to print its output back to the terminal, meaning stdout

Powershell has write-host vs write-output so your output doesn't potentially pollute the pipe. Any cli tool has the same option. There were plenty of tools in the 90's and early 00's that work like this because of how they were coded/compiled.