(adding your own) Help topic question

Welcome Forums General PowerShell Q&A (adding your own) Help topic question

Viewing 5 reply threads
  • Author
    Posts
    • #215406
      Participant
      Topics: 3
      Replies: 6
      Points: 23
      Rank: Member

      With <# #> I can create a help topic in  a blank script (meaning that in an otherwise blank script except for the help content when i type help scriptname.ps1 I get what I expect, the help content) but when I use this in an existing script the help just writes the scriptname as output.

      I clearly am looking over something very obvious but thought I try the forums to try to get a quick answer.

      I have the following script (see link: replaced servernames and UNC paths with _ but it basically goes for everything that has <# #> and then a few lines of code.

      https://gist.github.com/ST-oma/646e11b0b6e866366e0aedb7deb46f63bbbbbbbbv 

      For anyone wondering what the script is. I have a colleague that performs wonderfull stuff business wise but has no idea how to set up a proper database so we are stuck with an Access database with no unique id’s. Luckily for me Powershell has great functionallity and when parsing csv files into one for import in Access we also delete all doubles and perform some extra actions that should have been taken care of by others but aren’t.

      If anyone can give me a nudge in the right direction it is greatly appriciated!

    • #215412
      Participant
      Topics: 0
      Replies: 6
      Points: 84
      Rank: Member

      I placed your gistfile into a file testhelp.ps1.  When I ran the following I got the output that I expected.

      get-help .\testhelp.ps1
      
      1. What version of powershell are you using?  I testing on PSVersion 5.1.18362.628 and it came out successfully. I also tested on PSVersion 7.0.0-rc.3 and it came out as expected there as well.
      2. Is your script in the path? If not, did you include the.\?
      3. In gist your file has a .txt extension. Is it that way on your local filesystem, or does it have a proper .ps1 extension?
    • #215430
      Participant
      Topics: 3
      Replies: 6
      Points: 23
      Rank: Member

      That rules out a lot of stuff and proves it is correct formatting and that maybe something else (environment wise goes wrong). I’ll look into that. Thank you for your reply.

       

       

    • #215442
      Participant
      Topics: 3
      Replies: 6
      Points: 23
      Rank: Member

      Regarding the feedback I got I tried to delete some line and now it’s to a point that everthing before the .NOTES is displayed, and evertyhing after .NOTES not. Moved .Notes content to the description but it stays unclear why it does what it does. Yet I have my help and that (plus knowing it is the right syntax I used before) is enough.

    • #215514
      Senior Moderator
      Topics: 8
      Replies: 1215
      Points: 4,335
      Helping Hand
      Rank: Community Hero

      The notes section will get displayed only if you go for Full help

      Get-Help YourScript -Full
      
      • This reply was modified 1 month, 4 weeks ago by kvprasoon. Reason: post correction
    • #215547
      Participant
      Topics: 3
      Replies: 6
      Points: 23
      Rank: Member

      Thnx, I just figured that out myself (always the best way) when I got the rest of the notes to work. It does prove that there’s always an answer within the community and posting a question and the feedback I get to them is very positive so thanks for answering.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.