Advanced Windows PowerShellError Handling, Debugging, “Script Cmdlets,” and More<br />Don Jones<br />Concentrated Technolo...
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it withi...
Agenda<br />Crazy amounts of demo, very little slide<br />Shell transcript and samples will be downloadable from Concentra...
Errors in PowerShell<br />Non-terminating errors take the behavior in $ErrorActionPreference<br />Must make terminating to...
Debugging<br />Write-Debug to write trace code<br />Write-Verbose to write “progress” info<br />$DebugPreference, $Verbose...
Advanced Functions<br />A function that looks and works and smells like a “real” cmdlet<br />Mainly just decorating functi...
Pretty cool stuff, eh?<br />Again – shell transcript/samples will be on ConcentratedTech.com by next week<br />
Final Q&A<br />Text DONJ to 50500 for contact info<br />See me for add’l resources<br />Books<br />Workshop recordings<br ...
Your Feedback is Important<br />Please fill out a session evaluation form drop it off at the conference registration desk....
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it withi...
Upcoming SlideShare
Loading in …5
×

Adv PowerShell error handling, debugging, and cmdlets

1,368 views
1,258 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,368
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Adv PowerShell error handling, debugging, and cmdlets

  1. 1. Advanced Windows PowerShellError Handling, Debugging, “Script Cmdlets,” and More<br />Don Jones<br />Concentrated Technology<br />http://ConcentratedTech.com<br />
  2. 2. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.<br />For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. <br />For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg<br />This work is copyright ©Concentrated Technology, LLC<br />
  3. 3. Agenda<br />Crazy amounts of demo, very little slide<br />Shell transcript and samples will be downloadable from ConcentratedTech.com by next week<br />Error Handling<br />Debugging Techniques<br />“Script Cmdlets” (Advanced Functions)<br />Tips along the way<br />
  4. 4. Errors in PowerShell<br />Non-terminating errors take the behavior in $ErrorActionPreference<br />Must make terminating to trap/handle<br />Use the –ErrorAction (-EA) parameter<br />Use –ErrorVariable (-EV) to capture the error in a variable<br />Use Try…Catch to actually catch the error<br />
  5. 5. Debugging<br />Write-Debug to write trace code<br />Write-Verbose to write “progress” info<br />$DebugPreference, $VerbosePreference<br />-debug and –verbose for scripts<br />Also: PSBreakpoints<br />
  6. 6. Advanced Functions<br />A function that looks and works and smells like a “real” cmdlet<br />Mainly just decorating function parameters and adding comment-based help<br />Couple of cool tricks to support –confirm and –whatif<br />Accept both pipeline and parameter input<br />Let’s make one<br />
  7. 7. Pretty cool stuff, eh?<br />Again – shell transcript/samples will be on ConcentratedTech.com by next week<br />
  8. 8. Final Q&A<br />Text DONJ to 50500 for contact info<br />See me for add’l resources<br />Books<br />Workshop recordings<br />Demo videos<br />Etc<br />Slide decks posted to ConcentratedTech.com by next week<br />
  9. 9. Your Feedback is Important<br />Please fill out a session evaluation form drop it off at the conference registration desk.<br />Thank you!<br />
  10. 10. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.<br />For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. <br />For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg<br />This work is copyright ©Concentrated Technology, LLC<br />

×