Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Hey, Scripting Guy! How Can I Use Leading Zeroes When Displaying a Value in Windows PowerShell?

(image) Hey, Scripting Guy! I just read your “using calculated properties” PowerShell Tip of the Week, and it addresses a problem I recently had. However, when I got to the last step in your article, I realized the file sizes – and my displayed values – are now left-justified. I’d like to use leading zeroes to align the numbers on ...