I'm reading "PowerShell Core for System Administrators" and I came to this example:
get-help get-command | out-string -s | select-string 'wildcard'
Seems equivalent to:
program-that-outputs-lots-of-text | grep 'wildcard'
But I don't understand the middle part. The explanation given is that output-string -s
chops up the input into individual strings rather than one big one. In that case I would expect omitting the middle part would lead to outputting the entire help file (because it's one string and it matches), but instead nothing at all comes out. Why is that the case?