Scripting Blog [archived]

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

PowerTip: Remove trailing space from a string by using PowerShell

Summary: Use the trim() method to remove leading and trailing spaces from a string. (image) Could you do me a huge favor and show me how to get rid of spaces before and after a string in PowerShell? (image) No problem at all. All you need to do is apply the trim() method to remove all the output. You can also use trimstart() to remove the ...

Build a hexadecimal clock in PowerShell – Part 5

Summary: Learn to split data in a Here-String and get a console beep. Honorary Scripting Guy, Sean Kearney, is here with our final day this week to wrap up building a hexadecimal clock in PowerShell. When we finished yesterday, we ran across a snag in our output. Most of our rows kept dropping to the immediate left of the screen as in the ...