# help does not work in the function

**URL:** <https://forums.powershell.org/t/help-does-not-work-in-the-function/12918>\
**Category:** PowerShell Help\
**Created:** [July 26, 2019, 4:53am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918 "2019-07-26T04:53:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![techsavy](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@techsavy](https://forums.powershell.org/u/techsavy)\
**Post date:** [July 26, 2019, 4:53am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/1 "2019-07-26T04:53:57Z")

</div>

I have created a function with the [cmdletbinding()] attribute, however when I run

help \<name of the function\> it does not return the help on the function. However the function works fine when I run it with the specified parameters.

and when I use help \<name of the function\> it is listed twice in the drop down menu. Any suggestions on this?

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [July 26, 2019, 4:57am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/2 "2019-07-26T04:57:05Z")

</div>

Hmmm … please be honest: Do you really think you provided enough information for us to be able to help you? 😉 😃 Please provide more detailed information.

---

<div class="post-metadata">

**Author:** ![bdevogt](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@bdevogt](https://forums.powershell.org/u/bdevogt)\
**Post date:** [July 26, 2019, 5:06am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/3 "2019-07-26T05:06:40Z")

</div>

Write it like this and show us

&nbsp;

[pre]

\<#  
.Synopsis  
Short description  
.DESCRIPTION  
Long description  
.EXAMPLE  
Example of how to use this cmdlet  
.EXAMPLE  
Another example of how to use this cmdlet  
#\>  
function Verb-Noun  
{  
[CmdletBinding()]  
[Alias()]  
[OutputType([int])]  
Param  
(

# Param1 help description

[Parameter(Mandatory=$true,  
ValueFromPipelineByPropertyName=$true,  
Position=0)]  
$Param1,

# Param2 help description

[int]  
$Param2  
)

Begin  
{  
}  
Process  
{  
}  
End  
{  
}  
}

[/pre]

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [July 26, 2019, 5:46am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/4 "2019-07-26T05:46:11Z")

</div>

Hmmm … I recommend to read [The PowerShell Best Practices and Style Guide](https://poshcode.gitbooks.io/powershell-practice-and-style/) - especially the chapter about Code Layout & Formatting and there particularily the paragraph about Indentation! 😉 😃

---

<div class="post-metadata">

**Author:** ![bdevogt](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@bdevogt](https://forums.powershell.org/u/bdevogt)\
**Post date:** [July 26, 2019, 5:53am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/5 "2019-07-26T05:53:26Z")

</div>

[quote quote=167929]Hmmm … I recommend to read [The PowerShell Best Practices and Style Guide](https://poshcode.gitbooks.io/powershell-practice-and-style/) – especially the chapter about Code Layout & Formatting and there particularily the paragraph about Indentation! 😉 😀

[/quote]  
thats the site 🙂

my editor works like a charm 🙂

&nbsp;

---

<div class="post-metadata">

**Author:** ![techsavy](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@techsavy](https://forums.powershell.org/u/techsavy)\
**Post date:** [July 26, 2019, 7:23am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/6 "2019-07-26T07:23:17Z")

</div>

I fixed one part of the issue. I deleted the Module folder and recreated it. It is under Documents\WindowsPowerShell\Modules\Get-Test\Get-Test.psm1

Now if I type help Get-Test, it shows the help. However still when I run help Get-T I see all the functions which start with Get-T and I see two listing for Get-Test, the first command works fine. However when I select the second Get-Test in the list, it types the below in the console.

help Get-Test\Get-Test

and when I run it, it returns an error saying Get-help: Get-help could not find Get-Test\Get-Test in a help file in this session.

---

<div class="post-metadata">

**Author:** ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)\
**Post date:** [July 26, 2019, 9:43am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/7 "2019-07-26T09:43:46Z")

</div>

Are you still using the PowerShell console session you opened before. Try opening a new console.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [July 26, 2019, 11:08am UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/8 "2019-07-26T11:08:22Z")

</div>

> [@](#):
>
> thats the site … my editor works like a charm

OK, so how do you think others do it here in this forum? 😉 … I’ll show you what I mean:

```
<#
.SYNOPSIS
A brief description of the function.

```
    .DESCRIPTION
        A detailed description of the function.

    .PARAMETER ParameterA
        The description of the ParameterA parameter.

    .PARAMETER ParameterB
        The description of the ParameterB parameter.

    .EXAMPLE
        PS C:\&gt; Get-Something -ParameterA 'One value' -ParameterB 32

    .EXAMPLE
        PS C:\&gt; Get-Something 'One value' 32

    .INPUTS
        System.String,System.Int32

    .OUTPUTS
        System.String

    .NOTES
        Additional information about the function go here.

    .LINK
        about_functions_advanced

    .LINK
        about_comment_based_help

#&gt;

```

function Test-AdvancedFunction {  
[CmdletBinding()]  
[OutputType([System.Int32])]  
param(  
[Parameter(Position = 0, Mandatory = $true)]  
[ValidateNotNullOrEmpty()]  
[System.String]  
$Name,

```
    [Parameter(Position = 1)]
    [ValidateNotNull()]
    [System.Int32]
    $Index
)
Begin {
    try {
    
    }
    catch {
        throw
    }
}
Process {
    try {
    
    }
    catch {
        throw
    }
}
End {
    try {
    }
    catch {
        throw
    }
}

```

}
```
  
I’d say: No, it’s not the site. 😉 😃

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:31pm UTC](https://forums.powershell.org/t/help-does-not-work-in-the-function/12918/9 "2024-05-16T20:31:56Z")

</div>


