Here is my challenge. I’ve taken a script that used to take a couple hours to process. Now, by leveraging jobs, I was able to reduce it to 2 minutes. Since this script does a large amount of output, (I previously wrote all of the output to flag csv files, then read them all in and the end and generated reports from them), I leveraged MSMQ to dump all of the out from the jobs. My intent is to come back at the end after all the jobs complete, read in each of the queues and create my report.
I have read that using += to add a large number of objects to an array is a bad idea that gets exponentially slower with a large amounts of data.
My questions is, what would be the best way to read in all of the objects from the queue so I can build a report? Before I read in a csv, used ConvertTo-HTML, and away I went.
I know I would have to build a loop to pull out each message to add it to a table or some such.
Any thoughts?