My 12 PowerShell Best Practices

Over the past few months, I've published a 12-part series of posts entitled "What To Do / Not To Do in PowerShell." These summarize my 12 major best practices for the shell, many of which are also enthusiastically endorsed by the broader PowerShell community. For your convenience, here they all are:
  1. Never use Write-Host
  2. Avoid $ErrorActionPreference
  3. Indent your code
  4. Spell out cmdlet and parameter names
  5. Don't use Hungarian notation
  6. Use multi-purpose "comments"
  7. Use mostly single quotes
  8. Use source control
  9. Use code signing
  10. Use cmdlet style naming
  11. Avoid the global scope
  12. Output objects

Please or Register to post comments.

What's PowerShell with a Purpose Blog?

Don Jones demystifies Windows PowerShell.

Blog Archive

Sponsored Introduction Continue on to (or wait seconds) ×