Question of possiblity for help section?

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Jason McMahan Jason McMahan 2 years, 1 month ago.

  • Author
    Posts
  • #19713
    Profile photo of Jason McMahan
    Jason McMahan
    Participant

    While creating a script today a question wandered through my mind.
    Is it possible to call specific section within help, and or return information?

    For instance

    < # .NOTES
          Created by: me
          Created on: today
          Version: 20141015.1
    

    Could I

     get-help get-script.notes 

    to return the notes section then if I wanted to focus down to Version I could?

    Just something to throw out there.

    Thank you very much for any input.
    Have a great day.

  • #19714
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Run

    Get-Help Get-Service | Get-Member

    You'll see that help is actually stored and parsed as objects, not plain text, and the various sections are accessible as properties. You can't use the syntax you suggested.

    Get-Help Get-Service | Select-Object -ExpandProperty Notes
    

    Would be more accurate, I think, as a pattern. This doesn't apply to about_ files, which are just plain text.

  • #19715
    Profile photo of Jason McMahan
    Jason McMahan
    Participant

    Wow that works great Don,
    Thank you very much for the direction on this.

You must be logged in to reply to this topic.