We will start with a pair of related scripts and put them together into a module - discussing what our options are, and the motivation for each change, we'll improve the functions by actually applying a list of best practices and code snippets including: - picking good parameter names - the help you can't not write - validating input values - outputting objects that are predictable *and identifiable* - binding parameters from the pipeline - why to avoid a single InputObject - finding work that can go outside the process block - outputting errors that are unrecoverable - recovering from errors when possible At the end of our time you'll have a series of reproducible steps, and a few code snippets and the knowledge to apply them to make your functions and even your modules more robust and more intuitive for users. I'll introduce attributes including [CmdletBinding()], [Parameter()] and [OutputType()] and we'll go over the difference between Write-Error and hrow (and maybe even $PSCmdlet.WriteError()) and talk briefly about the difference between a PSCustomObject with PSTypeNames and an object with a PowerShell class (and how to write parameters that accept _both_). PowerShell Summit videos are recorded on a "best effort" basis. We use a room mic to capture as much room audio as possible, with an emphasis on capturing the speaker. Our recordings are made in a way that minimizes overhead for our speakers and interruptions to our live audience. These recordings are meant to preserve the presentations' information for posterity, and are not intended to be a substitute for attending the Summit in person. These recordings are not intended as professional video training products. We hope you find these videos useful - the equipment used to record these was purchased using generous donations from members of the PowerShell community.
Get notified about new features and conference additions.