79471226

Date: 2025-02-26 23:15:09
Score: 1
Natty:
Report link

In the Posh Code site, their PowerShell Practice and Style guide, Don Jones, M. Penny, C. Perez, J. Bennett and the PowerShell Community suggest function documentation best practice places the comment-based help inside and at the top of the function it describes. Inside, so it does not get separated from the function, and at the top so developers see them and remember to update them.

In order to ensure that the documentation stays with the function, documentation comments should be placed INSIDE the function, rather than above. To make it harder to forget to update them when changing a function, you should keep them at the top of the function, rather than at the bottom.

Documentation and Comments

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Ethan H