-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to support dynamic parameters #483
Comments
Just came across this with the MSTerminalSettings 2.0. Is there a workaround perhaps, or am I going to have to develop my own? EDIT: I think this is blocked on PowerShell/PowerShell#6694 and more specifically PowerShell/PowerShell#3006 because if you just run get-help against a module, the same problem happens. @jdhitsolutions did you try removing all comment based help and see if the dynamic parameters show up? |
If I have time I can attempt a sufficient workaround that I POC'd:
|
@JustinGrote I rarely write comment-based help anymore. I'm running Platyps against clean code. I think a big part of the challenge how the dynamic parameter(s) are being detected. |
@jdhitsolutions It literally does this:
So if it doesn't show up in Get-Help it won't show up in PlatyPS. |
Is this related to the issue we arehaving with the following syntax? In the synopsis header .PARAMETER
None fails with following unhandled error: Get-Command : The term 'Remove-LegacySupportHybridWorker.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\andrew.sears\Documents\WindowsPowerShell\Modules\platyPS\0.14.0\platyPS.psm1:2360 char:17
+ return (Get-Command $help.Name -Syntax) -eq ($help.Synopsis)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Remove-LegacySupportHybridWorker.ps1:String) [Get-Command], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand .PARAMETER None succeeds. If not I will open another issue. Get-Help returns a minimal result rather than the full synopsis for this syntax, so this trivial issue with parameter name being on a different line probably needs to be bubbled up to Powershell team too. |
@jdhitsolutions - thank you for this issue. The nature of dynamic parameters with PlatyPS requires that the provider be loaded or that PlatyPS check the providers. This is outside the design of PlatyPS and we will need to further investigate. I've added to our future backlog for post 2.0 release review. |
I found an old issue from 2017 that is related to this and from what I can tell nothing has happened since. Platyps doesn't appear to detect dynamic parameters that are defined in a PowerShell function. Which on one hand I can understand. If I have a function that can work in both Windows PowerShell and PowerShell 7, but define a dynamic parameter that only works in PS7, I won't see the dynamic parameter when I create the markdown in Windows PowerShell.
What's the best way to display help or create provider aware help for that matter. To reference the old issue, if I define a dynamic parameter that relies on the CERT provider, how should I create help?
The text was updated successfully, but these errors were encountered: