Summary of the new feature / enhancement
It would be extremely convenient to support functions in the argument list for DSC resources.
Currently the only three ways to pass custom parameters to a process are:
- environment variables
- stdin
- An input argument of
{ "jsonInputArg": "-json"} or similar.
I would like to propose a 4th option. Strings generated by dsc functions.
This would massively decrease the need for custom programs whose only purpose is to deal with JSON.
Proposed technical implementation details (optional)
- Support
parser.parse_and_execute for each string within an "args" array.
- Add a
jsonInputArg() function to obtain the object representing jsonInputArg.
For example, a custom resource to set a system wide git config variable would look like:
"schema": {
"embedded": {
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
],
"title": "git_config",
"type": "object"
}
}
"set": {
"executable": "git",
"args": [
"config",
"set",
"--system",
"[tryget(jsonInputArg(),'key')]",
"[tryget(jsonInputArg(),'value')]"
]
}
Summary of the new feature / enhancement
It would be extremely convenient to support functions in the argument list for DSC resources.
Currently the only three ways to pass custom parameters to a process are:
{ "jsonInputArg": "-json"}or similar.I would like to propose a 4th option. Strings generated by dsc functions.
This would massively decrease the need for custom programs whose only purpose is to deal with JSON.
Proposed technical implementation details (optional)
parser.parse_and_executefor each string within an "args" array.jsonInputArg()function to obtain the object representing jsonInputArg.For example, a custom resource to set a system wide git config variable would look like: