Are there well-known PowerShell coding conventions?
- by Tahir Hassan
Are there any well-defined conventions when programming in PowerShell?
For example, in scripts which are to be maintained long-term, do we need to:
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?
It seems that MSDN lack coding conventions document for PowerShell, while such document exist for example for C#.