red-gate / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments
Other
63 stars 24 forks source link

RuntimeDefinedParameterDictionary Dynamic Parameters Support #48

Closed lordmilko closed 5 years ago

lordmilko commented 5 years ago

In #26 basic support for providing information on dynamic parameters was implemented. In the issue, @ChrisLambrou presented that IDynamicParameters.GetDynamicParameters could return anything (technically true), however according to the PowerShell source code, only two types of objects are actually supported

The fix in the previous issue appeared to implement support for the latter case utilizing the reflection dynamic parameter technique. I would present however that the most common type of dynamic parameter scenario is the RuntimeDefinedParameterDictionary technique.

By default, Get-Help will list all of your dynamic parameters in each parameter set if your cmdlet does not contain any help file information associated with it. As a result, XmlDoc2CmdletDoc not supporting this technique causes Get-Help to show less than it would without an XmlDoc2CmdletDoc help file in this scenario.

While obviously XmlDoc2CmdletDoc wouldn't be able to provide any specific documentation about each parameter, I would like to propose these parameters at least be listed as existing on the cmdlet as well as listing which parameter set each belongs to