Skip to content
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

Extend functions that implement classes for ParameterInfo and Command with additional parameter options #208

Open
steviecoaster opened this issue Jan 13, 2024 · 0 comments · May be fixed by #209
Labels
Issue-Enhancement New feature or request

Comments

@steviecoaster
Copy link

steviecoaster commented Jan 13, 2024

Summary of the new feature / enhancement

Based on the[ParameterInfo] source as an example, it would make sense to provide some additional parameters (or all of them) so a Crescendo module author can more completely construct things without additional code.

For example, dealing with parameters that require NoGap be set to $true currently requires something like this to be done:

$parameterInfo = New-ParameterInfo -Name MyParameter -OriginalName '--original-parameter-name'
$parameterInfo.NoGap = $true

Proposed technical implementation details (optional)

I propose that class members be added as parameters to available New-* functions so Crescendo module authors have less and cleaner code to write.

E.g. I'd like to see this work:

$piSplat = @{
Name = 'FancyParameter'
OriginalName = '--fancy-param'
Description = 'This describes the parameter'
DefaultValue = 'SomeDefault
NoGap = $true

New-ParameterInfo @piSplat

I"m happy to help here, if you want to tell me "PRs greatly appreciated!" 😂

@steviecoaster steviecoaster added the Issue-Enhancement New feature or request label Jan 13, 2024
steviecoaster added a commit to steviecoaster/Crescendo that referenced this issue Apr 11, 2024
This commit begins the work of improving the author experience when
accelerating a native command.

This commit exposes all properties off the Command class to the user
via the New-CrescendoCommand cmdlet. Further to exposing all available
properties, an ArgumentCompleter attribute has been introduced to the
Verb parameter to allow for tab completion of PowerShell built-in
approved verbs.
@steviecoaster steviecoaster linked a pull request Apr 16, 2024 that will close this issue
steviecoaster added a commit to steviecoaster/Crescendo that referenced this issue Apr 17, 2024
This commit improves the author experience when
accelerating a native command.

This commit exposes all class properties as function
parameters. Where appropriate an argumentcompleter
attribute has been introduced to further enhance
the authoring experience when working with the
Microsoft.PowerShell.Crescendo module.
steviecoaster added a commit to steviecoaster/Crescendo that referenced this issue Apr 18, 2024
This commit improves the author experience when
accelerating a native command.

This commit exposes all class properties as function
parameters. Where appropriate an argumentcompleter
attribute has been introduced to further enhance
the authoring experience when working with the
Microsoft.PowerShell.Crescendo module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant