Lessons Learned

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

January, 2014

Posts
  • Lessons Learned

    Getting Version Data From Comment Based Help

    • 0 Comments
    Disclaimer: There’s a lot of parse-by-prayer here. You Have Been Warned. Here’s the short form: I try to keep a change log of sorts in the comment-based help for my scripts. (I say try because that’s sadly the first thing to be omitted...
  • Lessons Learned

    Read-Host With a Timeout, Kind Of…

    • 0 Comments
    Let’s copy the stuff from the comment block first: This is an unholy union of $ost.UI.RawUI.ReadKey() and Read-Host. It is usable, but that's good enough for my current needs. Let's let the .DESCRIPTION speak for itself: Here are the limitations...
  • Lessons Learned

    Loop-de-Loop

    • 0 Comments
    Here’s a quick trivia question for you: Given the following two looping constructs: foreach ($item in $array) { Do-Something -With $i; } and for ($i = 0; $i -lt $array.Count; $i++) { Do-Something -With $i; } What's the difference? ...
  • Lessons Learned

    Testing Timestamps of Files Across a Slow Network

    • 0 Comments
    I’m not sure if this is because of network lag, or the fact that my lab is on a different AD domain (and different NTP clock) than my local computer.  All I know is: (Get-Item local\path\to\OriginalFile.txt).LastWriteTime –eq (Get-Item remote\path...
Page 1 of 1 (4 items)