Lessons Learned

My drop-site for interesting snippets and tips. If it's useful to you as well, great!

Browse by Tags

Tagged Content List
  • Blog Post: One-Liner: Padding a Number with Leading Zeroes

    I’m putting this here only because I’m tired of searching for it.  How to pad an integer with leading zeroes is trivial.  1..16 | % { "{0:D2}" -f $_ } And padding a float with trailing zeroes is more of the same: $i = 2; (1..10) | % { "{0:F5}" -f $i; $i = $i / 2; } Now, how about...
  • Blog Post: Why Use Semi-colons

    I get asked from time to time why I still put semi-colons at the end of each statement. Part of it is force of habit. Part of it is trying to make sure my script source is useful no matter how the web server, post edtior, and user's brower decide to display it. Sometimes, some combination of the above...
Page 1 of 1 (2 items)