3

How do I use the .PARAMETER option to add detailed information for the parameters of a function when writing the help for it? I tried ".PARAMETER $ParamName", that didn't work, and I tried ".PARAMETER -ParamName", that didn't work either.

Here's an example:

<#

.SYNOPSIS
short overview

.DESCRIPTION

longer overview

.PARAMETER

dont know how this works?

.EXAMPLE

Example code 

.NOTES

This is awesome!

.LINK

http://winfred.com
#>

1 Answer 1

4

Its not complicated, you simply use it as:

.PARAMETER NameOfParam
    Description of param

For example:

.PARAMETER MyParam
    MyParam does whatever bla bla bla...
Sign up to request clarification or add additional context in comments.

3 Comments

Also see: help about_Comment_Based_Help
A variant (that I prefer) is to put an explanatory comment immediately above the parameter definition. It will then automatically be included as parameter description in the help text.
And if you want multiple parameters, you'll just add another .PARAMETER MyOtherPara line/block

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.