powershellpowershell-5.0

Powershell 5: documentation support via comments for classes and enums members


Just wondering whether there is any support for comments considered as documentation for enums and classes members (methods and fields / properties) in PowerShell?


Solution

  • If you're referring to the equivalent of Comment-Based Help, I've seen no indication of any. However, if you're writing classes or enums, you are also presumably writing scripts or script cmdlets/advanced functions that rely on them; it wouldn't be unreasonable to document the classes or enums in the scripts/etc. that use them.

    Trevor Sullivan provides a link below to building your own about_Topic help data files; There is a brief description of creating a "Conceptual Help" file (or about_*) at https://learn.microsoft.com/en-us/powershell/scripting/developer/help/writing-help-for-windows-powershell-modules?view=powershell-7.5 ; this represents another possibility, and one that may well be more appropriate, depending on how you're using your classes/enums.