Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Write comment-based help in the exising scripts and functions #9

Open
chriskyfung opened this issue Nov 20, 2023 · 1 comment
Open
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@chriskyfung
Copy link
Owner

You should always write comment-based help in your scripts and functions.

Comment-based help is formatted as follows:

function Get-Example {
    <#
    .SYNOPSIS
        A brief description of the function or script.

    .DESCRIPTION
        A longer description.

    .PARAMETER FirstParameter
        Description of each of the parameters.
        Note:
        To make it easier to keep the comments synchronized with changes to the parameters,
        the preferred location for parameter documentation comments is not here,
        but within the param block, directly above each parameter.

    .PARAMETER SecondParameter
        Description of each of the parameters.

    .INPUTS
        Description of objects that can be piped to the script.

    .OUTPUTS
        Description of objects that are output by the script.

    .EXAMPLE
        Example of how to run the script.

    .LINK
        Links to further documentation.

    .NOTES
        Detail on what the script does, if this is needed.

    #>

Comment-based help is displayed when the user types help Get-Example or Get-Example -?, etc.

Your help should be helpful. That is, if you've written a tool called Get-LOBAppUser, don't write help that merely says, "Gets LOB App Users." Duh.

Further information: You can get more on the use of comment-based help by typing help about_Comment_Based_Help within PowerShell.

Reference

@chriskyfung chriskyfung converted this from a draft issue Nov 20, 2023
@chriskyfung
Copy link
Owner Author

ToDo:

  • Use .LINK to refer the GitHub repository

@chriskyfung chriskyfung added good first issue Good for newcomers documentation Improvements or additions to documentation labels Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant