My script makes multiple checks on remote machines like whether certain services are running, tasks are enabled, settings are set, groups exist. This time I would need to create some sort of report of the output rather than just display it on my screen . The output is of variable length hence difficult to format in a csv. Possibly html would be better as on consecutive runs I'll be only looking for deltas. My question is do I need to follow every line with something like convertto-html | out-file or is there a better way to consolidate the output and then pass it to out-file in the last step?
Have a look at our HTML Reporting ebook, from the Resources menu here. It covers doing some fairly complex, multi-part reports.
I'll disagree with David on the array – an array is a poor way to do this, and gets slower the larger you make the array. Outputting custom objects to the pipeline, in a modular, function-based approach (which is how the ebook proceeds) is a much more PowerShell-native pattern.
HTML reporting, Networking Guide, Error handling and even DSC... wow! Funny I never checked that section. Thanks for pointing me there although the wife won't be happy I'll skip a couple of weekends out 😉