You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discussion: DSL: json => PS with custom attributes #94
I love that we have Crescendo and I have many use cases. But it's a hard sell to my team, because the creation of JSON files is different enough to the normal workflow to present a barrier to adoption.
I propose a DSL based on custom attributes that lets these be written as powershell script instead.
As a discussion starter:
[Crescendo.Command(OriginalName = 'bcu.exe', OriginalCommandElements = @('diag'), OutputHandlers = 'Parse-BcuDiagOutput')]
function Get-BcuDiag
{
param
(
[Parameter()]
[Crescendo.Parameter(OriginalName = "--tempshow")]
[switch]$ShowTemperature
)
# no function body - that's Crescendo's job
}
Freddie Sackur (@fsackur) - Thank you for opening this discussion. I’m going to transfer this to the Discussions page. Also linking similar discussion "Why JSON instead of psd1?" #96
This is not on our plans for the crescendo GA, but I’m very interested in this discussion as adoption and the ease of creating the configuration files is important. Our focus has been to make the schematized JSON configuration as simple as possible, and we are investigating autogeneration of the configuration for newer native commands that produce structured output like Docker or kubectl. This wouldn’t cover all scenarios, especially older commands. As this investigation progresses, I will share more information here. Depending on community feedback, the autogeneration might be something we could look at doing post Crecendo GA.
This doesn’t address those folks that would prefer to use PowerShell script to create the JSON configuration and I would be interested in further understanding:
What are the benefits to the authors/maintainers of Crescendo modules by adding the extra step of writing PowerShell script to generate the JSON?
Could some of the challenge to editing a JSON file be lessened with better tooling such as cmdlet that lets you specific a new command and basic options as parameters?: I.e. New-CrescendoCommand -verb -Noun -Alias <string[]> -OriginalCommand -OriginalCommandElements <>
Because folks may have different approaches to scripting the JSON, I would be interested in seeing what approach the community takes.
Activity
theJasonHelmick commentedon Jul 28, 2021
Freddie Sackur (@fsackur) - Thank you for opening this discussion. I’m going to transfer this to the Discussions page. Also linking similar discussion "Why JSON instead of psd1?" #96
This is not on our plans for the crescendo GA, but I’m very interested in this discussion as adoption and the ease of creating the configuration files is important. Our focus has been to make the schematized JSON configuration as simple as possible, and we are investigating autogeneration of the configuration for newer native commands that produce structured output like Docker or kubectl. This wouldn’t cover all scenarios, especially older commands. As this investigation progresses, I will share more information here. Depending on community feedback, the autogeneration might be something we could look at doing post Crecendo GA.
This doesn’t address those folks that would prefer to use PowerShell script to create the JSON configuration and I would be interested in further understanding:
Thank you for opening the discussion!