Enable passing JSON input properties as args to resource
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 75
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 24
Description
Summary of the new feature / enhancement
There might be an existing CLI tool or the developer wants their CLI tool to serve as both a user facing tool but also DSC resource. So in that case, they wouldn't want to receive and process a JSON payload.
Proposed technical implementation details (optional)
In the resource manifest, we can add support for expressions for the args:
{
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json",
"type": "Microsoft.Windows/User",
"version": "1.0.0",
"set": {
"executable": "net.exe",
"args": [
"user",
"[input().name]",
"[input().password]",
"/add"
]
}
}
input() would be a new function that returned the values under properties. Normal dot-notation rules apply. Any functions that result in an object would be an error. secureString would resolve to plain-text.
For get and export, the tool would still be required to return JSON output and the manifest would specify something like:
"/output",
"json"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the resource manifest handling and expression evaluation entry points for set arguments. Define how input() resolves properties, how object results and secureString values are handled, and how get/export continue to require JSON output; the example manifest provides the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100