I want to have my script output status updates as it runs. It's a simple script that installs basic stuff as unattended as possible (sadly not fully unattended).
How you see below is how I've been doing this. I want this to be very human-readable, as I'm likely not the only one who's going to use this script.
I want to display two columns. One with the message saying what's happened, and one with what it's applied to.
I don't believe tables will work, as I want it to output each line individually in case if one actually fails hard enough to crash the script, or anything like that. To the best of my knowledge, tables are output all at once.
Currently I'm using strings with an excess of spaces. This works, but I feel like there has to be a more elegant way to do this. A way that I can just feed something a bunch of strings, finds the length of the longest one, and adds all the spaces necessary to make them the same length.
Current Variables
$Already = "Already Installed "
$Installing = "Installing "
$Installed = "Installed "
$Run = "Run "
$Warning = "WARNING "
$Failed = "FAILED "
$NotFound = "NOT FOUND "
$SWhatIf = "WhatIf "
Desired Output
Write-Host "${Installing}Google Chrome"
Installing Google Chrome
Write-Host "${Already}Adobe Reader"
Already Installed Adobe Reader
Write-Host "${Run}7-Zip"
Run 7-Zip