I'm writing a program that outputs a display to the screen containing information on the status of a process running on multiple computers. I've deliberately avoided arrays, objects, and format-table so that I can output each member of the information in a different color based on the status. Example:
Server Service Status Latest config backup
------------------------------------------------
Srv01 Running 2021-01-13_1500.bak
The Running will be green, the backup file will be green or red based on the age, etc.
This means a nasty set of:
write-host "`r`t`t`t`t`t`t`t`t`t`t`t`t`t`t`t`t`t`t$servicestatus" -nonewline -foregroundcolor $color
What I've discovered however is that once I hit 15 consecutive `t
entries, my powershell window will start to mess up and ignore the initial `r
and I end up with text wrapping onto a new line due to reaching maximum screen width.
Server Service Status Latest config backup
------------------------------------------------
Srv01 Running
2021-01-13_1500.bak
examples above exaggerated, length not to scale.
If you can suggest a way to put colors in a format-table, I'll happily switch to an object or array or whatever.