There are at least two possibilities. First (better imho): use Get-Command :
# my test file @' param( $p1, $p2 ) write-host $p1 $p2 '@ | Set-content -path $env:temp\sotest.ps1 (Get-Command $env:temp\sotest.ps1).parameters.keys
For all participants look
Get-Command $env:temp\sotest.ps1 | gm #or Get-Command $env:temp\sotest.ps1 | fl *
Another (harder way) is to use regex
[regex]::Matches((Get-Help $env:temp\sotest.ps1), '(?<=\[\[-)[\w]+') | select -exp Value
source share