![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Is there any info MamlCommandHelpInfo class 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 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Is there any info MamlCommandHelpInfo class 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@xxxxxxQuote: > 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 |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Is there any info MamlCommandHelpInfo class I'll have to look at your script, I'm not directly using the Get-Help functionality perhaps thats the way to go. In regards to the membes that are added I had saw them but how to use them is not obvious. Take a look at the Syntax, Exampes Noteproperty members. thx bob "Kirk Munro [MVP]" wrote: Quote: > 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@xxxxxxQuote: > > 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 > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Is there any info MamlCommandHelpInfo class I totally agree. Creating the Syntax structure took a lot of troubleshooting on my part. You can see script that specifically does this in the script block I mentioned below that is part of the CmdletExtensionLibrary.ps1 script file. -- Kirk Munro [MVP] Poshoholic http://poshoholic.com "Bob Landau" <BobLandau@xxxxxx> wrote in message news:61BF1EB7-C6A7-4352-8BC5-51A18D3A0964@xxxxxx Quote: > I'll have to look at your script, I'm not directly using the Get-Help > functionality perhaps thats the way to go. > > In regards to the membes that are added I had saw them but how to use them > is not obvious. Take a look at the Syntax, Exampes Noteproperty members. > > thx > bob > > "Kirk Munro [MVP]" wrote: > Quote: >> 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@xxxxxxQuote: >> > 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 >> >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| When a class is both an inherited class of another, and alsoimplements an interface method | .NET General | |||
| w= cInt(left(info,inStr(info,"x") -1)) | VB Script | |||
| win32_pingstatus class / dns class | PowerShell | |||
| How do I change the administrator info and the registration info?? | Vista account administration | |||