Class-based resource capabilities in module manifest
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 75
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 24
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Summary
There is an option in the module manifest to set which capabilities are present for a resource however that applies to all resources in the module and not to individual resources.
The schema should be updated to allow individual resources to specify their capabilities.
PSData = @{
DscCapabilities = @{
TestClassResource = @('get', test', 'export)
NoExport = @('get', test')
}
}
The ideal state is to allow class-based resources to not have to implement all methods. This could be done by checking the AST if the method contains a throw [NotImplementedException]::new() so that the code and capabilities match at all times.
Steps to reproduce
n/a
Expected behavior
n/a
Actual behavior
n/a
Error details
Environment data
n/a
Version
3.1-preview6
Visuals
No response
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 with powershell-adapter/psDscAdapter/powershell.resource.ps1 around lines 90-100 and inspect how module-wide DscCapabilities are read. Review the manifest schema and determine how individual class-based resources should declare capabilities, including whether the proposed AST check for NotImplementedException is in scope. Done means the schema and adapter consistently support per-resource capabilities.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100