Question of possiblity for help section?

This topic contains 2 replies, has 2 voices, and was last updated by  Jason McMahan 3 years, 9 months ago.

  • Author
  • #19713

    Jason McMahan

    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

    Don Jones


    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

    Jason McMahan

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

You must be logged in to reply to this topic.