Slide 8
Slide 8 text
Guy’s Top Tips
• Where RTFMing lets you down, use Az.* PS modules & run with –Debug 5>debug.txt to get URLs, headers, body
• Cater for transient failures (error 500, timeout & similar) – sleep & retry a small number of times
• Avoid hard coding, e.g. URLs – use script parameters with defaults or declare as variable at top of script
• Always think “what if this fails or what if it returns 0, 1 or more than 1 item – can my code cope?”
• Watch for infinite (tight) loops
• Use meaningful variable & function names, no aliases, use full named parameters & add comments/references
• Plenty of examples on line but check not accidentally/intentionally malicious/destructive/stupid
• Re-use/improve scripts/modules but give credit to source (e.g. in a comment) & give back to the community