Is there any recommended coding style how to write PowerShell scripts?
It\'s not about how to structure the code (how many functions, if to use modu
I recently came across an excellent point about indent style in PowerShell. As the linked comment states, observe the difference between these same syntaxes:
1..10 | Sort-Object
{
-$_
}
and
1..10 | Sort-Object {
-$_
}
While my inclination is to "do as the Romans do" and use the standard C# indentation style (Allman, more or less), I take issue with this exception and others similar to it.
This inclines me personally to use my favored 1TBS, but I could be convinced otherwise. How did you settle, out of curiosity?