~/talk

Bullet-proofing Patterns & Practices

slides:none on file

Walks through converting two scripts into a reusable module and shows exact changes: use [CmdletBinding()], [Parameter()] and [OutputType()] attributes, add try/catch that rethrows, log exceptions to the information stream so the real Exception object and timestamp persist, validate and rename parameters for clarity, bind by pipeline or property name, move one-time setup to Begin and per-item work to Process, prefer PSCustomObject with PSTypeNames or PowerShell classes as appropriate, and add an argument transformation to accept both module names and PSModuleInfo.

AI-written summary · about

  1. 0:00Start
  2. 0:11How to Bulletproof Your Code
  3. 1:48Disclaimer
  4. 9:42Error Handling
  5. 10:07Exception Handling and Error Handling in Powershell
  6. 11:49Custom Logging Module
  7. 15:42Usable Commands
  8. 19:32Synopsis
  9. 20:14Examples
  10. 20:35Mandatory Parameters
  11. 21:23Parameter Documentation
  12. 21:56Write Tests
  13. 28:26Makes a Good Parameter Name
  14. 29:59Console Color
  15. 34:31Menu for Tab Completion
  16. 36:21When Should I Use Username and When Should I Use Credential
  17. 40:47Import Configuration
  18. 41:55Argument Transformation Attribute
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.