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:
- Never use Write-Host
- Avoid $ErrorActionPreference
- Indent your code
- Spell out cmdlet and parameter names
- Don't use Hungarian notation
- Use multi-purpose "comments"
- Use mostly single quotes
- Use source control
- Use code signing
- Use cmdlet style naming
- Avoid the global scope
- Output objects
Enjoy!
0 comments
Hide comments