I'm working on diagnosing some dependency issues in my C++ project and I tried using this command in PowerShell: `vcpkg depend-info qtbase | Select-String -Pattern "font"`. However, it seems like it doesn't do anything, and I still see the full output from `vcpkg`. I even tried using RipGrep (`rg.exe`) with the same result. I'm really struggling with PowerShell, any tips on how to make this work?
5 Answers
It's a common misconception to blame PowerShell here. The output could be similar in command prompt too. Try running `vcpkg depend-info qtbase > file.txt` and see if you get anything. Another alternative in PowerShell is `Cmd /c vcpkg depend-info qtbase | Select-String -Pattern "font"`, which wraps the call in a command prompt and helps redirect the output properly.
Great suggestions here! I've run into similar output issues before, and these tips are very useful. I hope you find what you're looking for soon.
You can redirect standard error to standard output with this command: `vcpkg depend-info qtbase 2>&1 | Select-String -Pattern "font"`. Give that a try! It worked for me when I faced a similar issue.
This did the trick, thank you! I’ve had a similar issue on Linux with Docker, but I didn’t think to apply the same approach here. Why does it write to stderr in this case, though?
Just remember that `vcpkg` is its own application, and it decides how to handle output. You might want to validate how it sends output or force everything to redirect to standard output to make sure you catch everything.
Have you checked if the output is actually an object? You can try using `Select-Object -Property *` to see what you're dealing with. You could also use `Get-Member` to explore what's available.

I see your point about output devices. Still, isn't `vcpkg` supposed to output to stdout since it's a CLI tool? I'm confused about where else it would send the output.