Last active
August 29, 2015 14:03
-
-
Save Dan1el42/608e6e9d6886cdb0d20d to your computer and use it in GitHub Desktop.
Extract help from script. Posted by Michael West on Google+.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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