Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

[Question] Reading the Notes section from Get-Help

$
0
0

Consider this script

Function Invoke-Whatever { <# .SYNOPSIS Executes Whatever .DESCRIPTION Executes Whatever and return whatever .NOTES Author : supermamon Created : 17 Oct 2016 #> [CmdLetBinding()] param() "whatever" } Clear-Host; # Getting the Synopsis is pretty easy $Synopsis = Get-Help -Full -Name Invoke-Whatever | Select-Object -ExpandProperty Synopsis # Getting the Description is also fine $Description = Get-Help -Full -Name Invoke-Whatever | Select-Object -ExpandProperty Description # Although I need an additional step $Description = $Description.Text # But Notes? # This is empty Get-Help -Full -Name Invoke-Whatever | Select-Object Notes # This just fails Get-Help -Full -Name Invoke-Whatever | Select-Object -ExpandProperty Notes 

This is part of a larger project. The objective is to list all the commands/functions/cmdlets in a module and display its documentation. The trouble I’m having is getting the .NOTES section. Tried investigating using Get-Member…

Get-Help -Full -Name Invoke-Whatever | Get-Member 

but didn’t give me any clues.

Beside parsing and/or doing some RegEx magic, any ideas?

submitted by /u/supermamon
[link] [comments]

The post [Question] Reading the Notes section from Get-Help appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles