Lessons Learned

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

October, 2011

Posts
  • Lessons Learned

    Hash to Arrayof Objects

    • 0 Comments
    As an old-time Perl user, I love hashes. In Perl, hashes are the answer, no matter what the question is. (No, not really, but they solve a lot of problems.) In PowerShell, hashes are cool, but you can't do things like "Sort-Object -property value". ...
  • Lessons Learned

    Propagating Default Options

    • 0 Comments
    Let's say I have a function that takes parameters, which all well-written ones should. And they have intelligent defaults, again as well-written ones should. The outer script exposes those parameters via the outer param() statement, but how do I pass...
  • Lessons Learned

    No Reply All

    • 0 Comments
    Short form: Go here http://research.microsoft.com/en-us/projects/researchdesktop/noreplyall.aspx Longer form: Outlook/Exchange, like so many other products, has some 'undocumented features', including a one-bit flag that allows reply-all or not. This...
  • Lessons Learned

    Heavyweight Help in V1

    • 0 Comments
    Again, in V1 PSH, this is what I use for nicely formatted help. If you're on V2, by all means, use the inline help, PLEASE! function Break-Line { # synopsis:: # [-help] # # Description:: # Inserts linefeeds into strings read from STDIN so they wrap...
  • Lessons Learned

    Getting Remote Event Logs

    • 1 Comments

    Quick and dirty wrapper for LogParser to download Event Logs

    ...
  • Lessons Learned

    Quick and Dirty Help

    • 0 Comments
    I like writing help text for my scripts. Yes, PSH V2 allows Get-Help to parse the inline help in scripts, but I'm stuck in V1 for my production environment. For quick-and-dirty scripts where I don't want to implement a 'real' help subsystem, I use the...
Page 1 of 1 (6 items)