Agenda Crazy amounts of demo, very little slide Shell transcript and samples will be downloadable from ConcentratedTech.com by next week Error Handling Debugging Techniques “Script Cmdlets” (Advanced Functions) Tips along the way
Errors in PowerShell Non-terminating errors take the behavior in $ErrorActionPreference Must make terminating to trap/handle Use the –ErrorAction (-EA) parameter Use –ErrorVariable (-EV) to capture the error in a variable Use Try…Catch to actually catch the error
Debugging Write-Debug to write trace code Write-Verbose to write “progress” info $DebugPreference, $VerbosePreference -debug and –verbose for scripts Also: PSBreakpoints
Advanced Functions A function that looks and works and smells like a “real” cmdlet Mainly just decorating function parameters and adding comment-based help Couple of cool tricks to support –confirm and –whatif Accept both pipeline and parameter input Let’s make one
Pretty cool stuff, eh? Again – shell transcript/samples will be on ConcentratedTech.com by next week
Final Q&A Text DONJ to 50500 for contact info See me for add’l resources Books Workshop recordings Demo videos Etc Slide decks posted to ConcentratedTech.com by next week
Your Feedback is Important Please fill out a session evaluation form drop it off at the conference registration desk. Thank you!