Observations on writing to Screen and File in PowerShell

When writing a PowerShell script, you are typically doing “something” with “something” and getting a result based on this “doing”.

This is all well and good, but after you have gotten your result what do you do with the data? Two common scenarios are writing the result either to the screen or to a file. If the script is doing a lot of calculations, it’s quite common to also give the user some kind of feedback while it’s working, to indicate that it’s actually doing what it’s suppose to do and that it haven’t stalled. (more…)