I am currently writing a new line to a CSV-file each time I successfully/unsuccessfully execute a command in my script with the export-csv command. The resulting file is a logfile.
I would like to store all of this output into some kind of variable and write it all in one go at the end of the script.. This sounds far more efficient and clever as I am currently opening/writing/closing my csv file hundreds of time on each run..
But how would I do this? Any help is greatly appreciated as always!!