I am still not clear as to how strings work in powershell.
The commands below are for educational purposes, hence they look contrived.
If I do
echo “a b” | ls ls shows the contents of folder “a b”.
But If I do
echo “a b” | out-string | ls It throws an error
while adding -stream to out-string make it work. The documentation says this
"By default, Out-String accumulates the strings and returns them as a single string, but you can use the stream parameter to direct Out-String to return one string at a time. "
It seems the opposite. Without -Stream it should be one string and yet ls is interpreting it as separate strings.