Export to CSV and view output on the screen

Question:

Is there a way to export data as a CSV and view the output on the screen at the same time?
The code below produces what I need, but if I use “tee” instead of Export-CSV, the data is stored the same way as I see on the screen (as I would expect)

Code:

Produces:

If I use “tee”, the Output on the screen and in the file look like this:

Is there a way to format the screen and csv to look like a csv?

Answer:

Source:

Export to CSV and view output on the screen by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply