Thomas Raynor provides a quick tip for string formatting in Powershell:
And, for some reason, instead of the default output which is formatted like a table, I want output presented like this.
123 .ps1 file extension: 11.xlsx file extension: 3.dll file extension: 1This is a silly example, but notice that even though there are extensions of varying length (.ps1 and .dll are four characters including the dot, and .xlsx is five), all of the “file extension: <number>” is aligned.
How’d I do that?
Read on to learn how.
Comments closed