Advanced PowerShell Functions -- and Script Club
I just realized that after discussing this a bit on our mailing list, I never posted the information to the website! The Upstate NY PowerShell Users Group will be meeting January 17th (the 3rd Tuesday of the month). Following requests from a couple of our members ...
We're going to try to go back to basics over the next few months. Please join us!
We will be going back to a series I started a while ago on PowerShell Scripting best practices, and for the next few months we're going to try a different version of the mixed-format meeting. Rather than having two presentations at beginer and advanced levels, we're going to focus on (as someone put it in an email): Powershell 2.0 fundamentals.
Here's the new format (feedback welcome): We will start each month with a short presentation on a specific area of powershell scripting techniques, and then follow that with a hands-on Script Club / Lab. As always, please bring any interesting ideas or problems to Script Club and we'll try to help each other write those scripts. The focus of Script Club will be the ideas and problems that you bring with you, and on writing solutions for them following the best practices discussed in the presentation.
This Month: Writing Better Functions
Live Meeting Link: https://www.livemeeting.com/cc/mvp/join?id=4695TP&role=attend
Since this will be the start of a series of presentations on the fundamentals, I want to go back and cover some fundamentals of functions with PowerShell. I've talked a little about these as part of a larger presentation previously, and some of what I would otherwise have to talk about was covered in Ed Wilson's Presentation and Q&A from this month, (if you haven't seen that, you should watch the recordings, there are two, each about an hour). If we have time, we will finish with writing functions that work in pipelines or have multiple parameter sets.
Overview:
- Taking Parameters in Functions
- Writing Help for Functions
-
Advanced Parameters:
- Default values
- Mandatory parameters
- Non-Positional parameters
- Validation rules
- Aliases
-
Common Functionality
- Verbose, Debug, ErrorAction
- WhatIf and Confirm
-
Writing for the Pipelin
- Using Begin, Process, and End blocks
-
"Parameter Sets" and overloads
- Parameters that exist in multiple sets
- Changing the order of positional parameters
- Gotchas & Q&A
Don't forget about Script Club!
I have a pre-submission for script-club this month, in case it's interesting to you, one of the th
Also, please RSVP if you're coming and let me know if you'll be here for Pizza:
As always, we will start at 6PM with some Pizza and socializing, and the presentation will start at about 6:30. We will make the presentation available via Live Meeting, but obviously you should come in person for Pizza & Script Club!
