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…)

Change the PowerShell console size and state programmatically

Being able to change the size of the console window (or any window for that matter) are quick and easy to do using the mouse. The same for changing the window state (for example maximizing a window). But if you want to do this programmatically (for whatever reason) it’s not so simple.

I have created a small function that makes this much easier to accomplish. (more…)