Skip to content

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

Description

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!" 😂

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions