Hi Bob,
MamlCommandHelpInfo is just a custom PSObject with a specific type name
attached to it. Take a look at the results of the following two commands:
Get-Help Get-Member | ForEach-Object { $_.GetType() }
and
Get-Help Get-Member | ForEach-Object { $_.PSObject.TypeNames }
The former shows that the base type is PSCustomObject, and the latter shows
that it is actually derived from another extended object. And both extended
objects have been assigned custom names.
Now look at this:
Get-Help Get-Member | ForEach-Object { $_.PSBase.Members |
ForEach-Object { $_.Name } }
and
Get-Help Get-Member | ForEach-Object { $_.PSObject.Members |
ForEach-Object { $_.Name } }
In this case the former shows you the members that were added to the base
object (which has an extended type name of HelpInfo) and the latter shows
you those members plus additional members that were added to the derived
object (which has an extended type name of MamlCommandHelpInfo).
So while I haven't done this entirely from scratch, I have spent a lot of
time with the MamlCommandHelpInfo class and I've published a script that
should be able to help you out here. Take a look at this script:
http://www.powershellcommunity.org/S...4/Default.aspx
It contains a Get-Help function that wraps the Get-Help cmdlet so that
dynamic parameters are properly documented, regardless of which snapin they
come from. Inside this function there is a
$createDynamicParameterHelpInfoScriptBlock that shows you how I dynamically
create part of the help documentation (in this case I'm just adding dynamic
parameter details) that shows up from the MamlCommandHelpInfo object.
Functions missing help is something that is lacking in PowerShell 1.0. It
should be possible to add support for that and have it built directly into
the Get-Help call by wrapping it similarly to what I have done in my script.
--
Kirk Munro [MVP]
Poshoholic
http://poshoholic.com
"Bob Landau" <BobLandau@xxxxxx> wrote in message
news

3CBCE68-F498-409F-BF15-8978D358951F@xxxxxx
> I'm at the last part of my function which will provide extend
> functionality
> to what Get-Member does. The only part left is to spit out the man page.
>
> I had hoped to format it like
>
> Get-Member -?
> Help Get-Member
>
> The reason is it word wraps so nicely on the screen. I am also hoping that
> that this will be as easy to duplicate as the formating that Get-Members
> uses
> (all I needed to do was instanciate a MemberDefinition class which is
> documented) and let the default Powershell formating do its job.
>
> I was able to "reverse engineer" what Help does by
>
> (get-process -?) | get-member
>
> but I'm at a dead end here.
>
> I suspect others I have done this and can give me some advise. This is
> written as a Powershell function not a Cmdlet but I don't know that makes
> a
> difference.
>
> thx
> bob