Lessons Learned

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

May, 2014

Posts
  • Lessons Learned

    HP Power Supplies

    • 0 Comments
    HP servers have redundant power supplies.  SCOM will tell me which one is broken if it’s down, but in this case, I lost power to one side of the rack, and want to see if replacing the distribution unit fixed the issue.  Here’s a quick-and-dirty...
  • Lessons Learned

    #StupidProfileTrick - FunctionList

    • 0 Comments
    As I previously posted, my $Profile is stupidly complicated, and it adds a ton of functions.  Which ones did I add? (Reason this is of interest to me is because I mistakenly named a function with the same name as a cmdlet.  Yeah, totally stupid...
  • Lessons Learned

    Something I Should Have Done a While Ago: $continue

    • 1 Comments
    $ErrorActionPreference is your friend.  However, ‘SilentlyContine’ isn’t, especially when it’s misspelled as is this case.  If we could Tab-complete it, that’d be great. Hey…. I’ve added this to my $PROFILE (actually my CommonFunctionLibrary...
  • Lessons Learned

    8.3, the Undead Path

    • 0 Comments
    8.3 is a common reference to the DOS name limit of 8 characters for the filename and 3 characters for the file extension.  E.g.: command.com. NTFS did away with that, but it still haunts us in the form of legacy .BAT files that can’t handle file...
  • Lessons Learned

    Write-Error, $Error, and Users

    • 0 Comments
    Write-Error is useful, but the output is intimidating for new users.  You want them to see a nice message, but they get a wall of red text including a stack dump. Here’s a way to output it as a warning, but populate $Error as well. function Out-Error...
  • Lessons Learned

    VM Host

    • 0 Comments
    Here’s the one-liner: reg query "HKLM\Software\Microsoft\Virtual Machine\Guest\Parameters" /v hostname Here’s the wrapper function Get-VmHostName { <# A fancy way to run remotely reg query "HKLM\Software\Microsoft\Virtual...
Page 1 of 1 (6 items)