title: How to enable a PowerShell script to return help text when using Get-Help or -?
body: <p>How do I get my PowerShell script to display help when a user requests help via:</p>
  
  <pre><code>Get-Help -Name myscript.ps1
  </code></pre>
  
  <p>or</p>
  
  <pre><code>myscript.ps1 -?
  </code></pre>
  
  <p>For example, to describe my scripts parameters etc.</p>
  
  <p><strong>Updated question</strong> </p>
  
  <p>I tried the suggested answers. But I don't see the expected output. </p>
  
  <p>I simply place added the following code to myScript.ps1.</p>
  
  <pre><code>&lt;#
  .SYNOPSIS
      A short description of your script.
  
  .DESCRIPTION
      A longer description of your script.
  
  .PARAMETER &lt;-silent&gt;
      First parameter is -silent. It will do Collection Bootstrap silently.  
  
  .PARAMETER &lt;action&gt;
     Second parameter is action. Action could be either bootstrap or join
  
  #&gt;
  </code></pre>
  
  <p>When I tired </p>
  
  <blockquote>
    <p>Get-Help .\myScript.ps1</p>
  </blockquote>
  
  <p>, it shows as follows</p>
  
  <pre><code>NAME
      C:\es\dev\myScript.ps1
  
  SYNOPSIS
      A short description of your script.
  
  
  SYNTAX
      C:\es\dev\myScript.ps1 [&lt;CommonParameters&gt;]
  
  
  DESCRIPTION
      A longer description of your script.
  
  
  RELATED LINKS
  
  REMARKS
      To see the examples, type: "get-help C:\es\dev\myScript.ps1 -examples".
      For more information, type: "get-help C:\es\dev\myScript.ps1 -detailed".
      For technical information, type: "get-help C:\es\dev\myScript.ps1 -full".
  </code></pre>
  
  <p>I was expecting to see the description of the parameters. I tried both.PARAMETER &lt;-silent> and .PARAMETER -silent.  Same results. What is wrong? </p>
  
  <p><strong>Related question update 2 after processing more</strong>  </p>
  
  <p>I can see the help file after adding parameter section as follows:-</p>
  
  <pre><code>param (
  
      [Parameter(ParameterSetName='taskJsonFile', Position=1, Mandatory=$true)]
      [String]$taskJsonFile="tasks.json"
  )
  </code></pre>
  
  <p>But very important to see full help file I must use<br>
  <strong>Get-help .\myscript.ps1 -full</strong>
  Otherwise, it doesn't show full help information. </p>
  
  <p>But here comes my next question. When I tried -full. It shows some irrelevant information. I would like to omit this information to be shown to the user. Now it displays as following:-</p>
  
  <blockquote>
    <p>NAME
        C:\es\dev\myscript.ps1</p>
    
    <p>SYNOPSIS
        It performs Collection Bootstrapping silently or parameterized based.</p>
    
    <p>SYNTAX
        C:\es\dev\myscript.ps1 [[-action] ] [[-file] ] [[-sasHostname] ] []</p>
    
    <p>DESCRIPTION
        For silent operation, user has to fill configuration file with desired value at Eurostep.SAS.Collection Bootstrap.Config.psd1. This
    configuration file has to exist in
        the same directory of Eurostep.SAS.CollectionBootstrap.ps1 PowerShell script.</p>
    
    <p>PARAMETERS
        -action </p>
  
  <pre><code>    Required?                    false
      Position?                    2
      Default value                bootstrap
      Accept pipeline input?       false
      Accept wildcard characters?  false
  
  -file &lt;String&gt;
  
      Required?                    false
      Position?                    3
      Default value                bootstrap_collection.json
      Accept pipeline input?       false
      Accept wildcard characters?  false
  
  -sasHostname &lt;String&gt;
  
      Required?                    false
      Position?                    4
      Default value                http://localhost:5000
      Accept pipeline input?       false
      Accept wildcard characters?  false
  
  &lt;CommonParameters&gt;
      This cmdlet supports the common parameters: Verbose, Debug,
      ErrorAction, ErrorVariable, WarningAction, WarningVariable,
      OutBuffer, PipelineVariable, and OutVariable. For more information, see
      about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
  </code></pre>
    
    <p>INPUTS</p>
    
    <p>OUTPUTS</p>
  
  <pre><code>-------------------------- EXAMPLE 1 --------------------------
  
  C:\PS&gt;.\myscript.ps1
  
  For silent Collection Bootstrapping no parameter. It reads values from configuration file myscript.Config.psd1
  
  
  
  
  -------------------------- EXAMPLE 2 --------------------------
  
  C:\PS&gt;.\myscript.ps1 bootstrap bootstrap_collection.json 'http://localhost:5000'
  
  All required parameter provided. Note that hostname must be inside ' '. Because it is a link.
  </code></pre>
    
    <p>RELATED LINKS </p>
  </blockquote>
  
  <p>I don't want to show <strong>RELATED LINKS INPUTS OUTPUTS </strong>, etc.</p>
  
  <p>Is there anyway to remove them from help informtion. Even -Full is used?</p>