PowerShell+ 2019 - Bullet-proofing Patterns & Practices by Joel "Jaykul" Bennett

Channel:
Subscribers:
42,400
Published on ● Video Link: https://www.youtube.com/watch?v=C_bOrPo6mcI



Duration: 44:38
10 views
0


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.




Other Videos By Confreaks


2022-09-05RustConf 2022 - Opening Keynote by Josh Triplett and Tyler Mandry
2022-09-01PowerShell+ 2019 - Doctor, Don't Defenestrate: What to Do with Legacy Scripts by Michael Lombardi
2022-09-01PowerShell+ 2019 - Firewall Evasion and Remote Access with OpenSSH by Anthony Nocentino
2022-09-01PowerShell+ 2019 - Securing PowerShell: Hands-On Lab by Ashley McGlone
2022-09-01PowerShell+ 2019 - Microsoft Azure Policy Guest Configuration by Michael Greene
2022-09-01PowerShell+ 2019 - Writing Compiled PowerShell Cmdlets by Thomas Rayner
2022-09-01PowerShell+ 2019 - Parselmouth - bending the PowerShell language by Mathias Jessen
2022-09-01PowerShell+ 2019 - PowerShell Remoting Internals by Paul Higinbotham
2022-09-01PowerShell+ 2019 - PSScriptAnalyzer (PSSA) VS-code integration & ... by Christoph Bergmeister
2022-09-01PowerShell+ 2019 - Unexplained phenomena: powerful tricks you likely didn't know... by Kirk Munro
2022-09-01PowerShell+ 2019 - Bullet-proofing Patterns & Practices by Joel "Jaykul" Bennett
2022-09-01PowerShell+ 2019 - Machine Learning Algorithms with H2o and PowerShell by Tome Tanasovski
2022-09-01PowerShell+ 2019 - CypherDog2.0 - Bloodhound Dog Whispering with PowerShell by Walter Legowski
2022-09-01PowerShell+ 2019 - Dungeons & Dragons & Development: How Playing Games Makes... by Michael Lombardi
2022-09-01PowerShell+ 2019 - Going Core with VMware PowerCLI! by Luc Dekens
2022-09-01PowerShell+ 2019 - Working with PSGraph by Kevin Marquette
2022-09-01PowerShell+ 2019 - Life after "git push" by Steven Murawski
2022-09-01PowerShell+ 2019 - Secure PowerShell web tools with System Frontier by Jay Adams
2022-09-01PowerShell+ 2019 - Demystifying Terraform - "Hardcore" to Core Infrastructure... Tool by Chris Hunt
2022-09-01PowerShell+ 2019 - PowerShell + AutoRest + Swagger = Instant Modules by Adam Murray
2022-09-01PowerShell+ 2019 - Testing, Testing, 1...2...3: Using Pester for Infrastructure ... by Brandon Olin