Skip to content

Instantly share code, notes, and snippets.

@Dan1el42
Last active August 29, 2015 14:03
Show Gist options
  • Save Dan1el42/608e6e9d6886cdb0d20d to your computer and use it in GitHub Desktop.
Save Dan1el42/608e6e9d6886cdb0d20d to your computer and use it in GitHub Desktop.
Extract help from script. Posted by Michael West on Google+.
$text = @"
<#
.SYNOPSIS
Sample comment
.DESCRIPTION
Other comment
#>
"@
$tokens = $null
$errors = $null
$ast = [System.Management.Automation.Language.Parser]::ParseInput($text, [ref]$tokens, [ref]$errors)
$help = $ast.GetHelpContent()
$help.Synopsis
$help.Description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment