help does not work in the function

Welcome Forums General PowerShell Q&A help does not work in the function

Viewing 7 reply threads
  • Author
    Posts
    • #167914
      Participant
      Topics: 15
      Replies: 68
      Points: 306
      Rank: Contributor

      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?

    • #167917
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      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.

    • #167923
      Participant
      Topics: 4
      Replies: 54
      Points: 406
      Helping Hand
      Rank: Contributor

      Write it like this and show us

       

    • #167929
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      Hmmm … I recommend to read The PowerShell Best Practices and Style Guide – especially the chapter about Code Layout & Formatting and there particularily the paragraph about Indentation! 😉 😀

    • #167932
      Participant
      Topics: 4
      Replies: 54
      Points: 406
      Helping Hand
      Rank: Contributor

      Hmmm … I recommend to read The PowerShell Best Practices and Style Guide – especially the chapter about Code Layout & Formatting and there particularily the paragraph about Indentation! 😉 😀

      thats the site 🙂

      my editor works like a charm 🙂

       

    • #167935
      Participant
      Topics: 15
      Replies: 68
      Points: 306
      Rank: Contributor

      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.

    • #167956
      Senior Moderator
      Topics: 9
      Replies: 1309
      Points: 4,784
      Helping Hand
      Rank: Community Hero

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

    • #167983
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      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:

      I’d say: No, it’s not the site. 😉 😀

Viewing 7 reply threads
  • The topic ‘help does not work in the function’ is closed to new replies.