Windows PowerShell Best Practices and Patterns: Time to Get Serious

Sign in to queue

Description

Windows PowerShell has found a place in our environments as a tool for automation—but are you using it in a way that's sustainable, supportable, and maintainable? Many Windows PowerShell scripters lack formal programming education, and can often produce code that isn't really well-suited to being a mission-critical part of the infrastructure. Change all that after attending this session.. Based on results from the 2013 Scripting Games and a summer-long community engagement, this session presents the practices and patterns that the Windows PowerShell community has identified as the most important for creating stable, performant scripts and tools. See examples of poor practices, along with community-endorsed alternatives that will help your shell scripts be as professional as possible.

Day:

3

Session Type:

Breakout

Code:

DCIM-B418

Room:

Grand Ballrm B

Embed

Download

Download this episode

The Discussion

  • User profile image
    GregSohl

    Pretty good session. You made several comments about the challenges with back ticks. We (my team) couldn't agree more. We NEED to get a good alternative syntax in PowerShell and make them and even your work arounds, go away forever!!

    Greg

  • User profile image
    Martin Nielsen

    At 55 minutes where you test different versions of creating a PSObject, I noticed in the first codeblock with Add-Member you never output the resulting PSObject to the $obj variable (the last Add-Member is missing a -PassThru).

    With that said I set up the test myself and it's not noticably faster or slower with the added -PassThru. The second option still wins by a large margin.

  • User profile image
    VernAnderson

    This session and the PowerShell unplugged were my 2 favorites that could be viewed remotely.

    I didn't get to attend this year.

  • User profile image
    Anders

    I agree much in all of your advices.
    Just wanted to say that in your splatting-array you dont need to surround your parameternames with ', and you dont need to end the line with semicolons.

Add Your 2 Cents