PowerShell programming conventions
- by Tahir Hassan
Do you follow any any conventions when programming in PowerShell?
For example, in scripts which are to be maintained long-term do you:
Use the real cmdlet name or alias?
Specify the cmdlet parameter name in full or only partially (dir -Recurse versus dir -r)
When specifying string arguments for cmdlets do you enclose them in quotes (New-Object 'System.Int32' versus New-Object System.Int32
When writing functions and filters do you specify the types of parameters?
Do you write cmdlets in the (official) correct case?
For keywords like BEGIN...PROCESS...END do you write them in uppercase only?
Thanks for any replies.