PowerShell / Crescendo

a module for wrapping native applications in a PowerShell function and module
MIT License
399 stars 37 forks source link

Dynamic element names and values #148

Closed jazuntee closed 2 years ago

jazuntee commented 2 years ago

I am trying to allow public properties to be defined on msiexec where the cmd element name can be dynamically specified via hashtable. This could also benefit from the option to specify the Gap character described in issue #32. 'msiexec /i PROPERTY=VALUE PROPERTY2=VALUE2'

For example, this could look something like:

{
    "OriginalName": "",
    "Name": "PublicProperties",
    "ParameterType": "hashtable",
    "Mandatory": false,
    "Description": "Public Properties",
    "GapCharacter": "="
}

This would also be useful as a catch-all to specify additional cmd elements when you do not want to parameterize everything via Crescendo.

JamesWTruher commented 2 years ago

this can be done today by specifying the parameter type as [string[]] and then when invoking, you would construct these as expected: invoke-thing -publicproperties Property=Value,Property2=Value2 which is probably more similar to how you would actually invoke it natively

theJasonHelmick commented 2 years ago

@jasoth - thank you -- this issue has been answered as is being closed. Please feel free to reopen if further discussion is desired.