Comments (5)
See, that's a great conversation to have. I innocently thought it wouldn't be too bad, and here's a list of dependencies ;)
Not urgent, but it's great to see what problem are needed to solve that issue.
from dscresource.template.
Those wanting to create class-based resource should be able to do so if there are no problems mixing mof-based and class-based. This repo could be made the proof of that.
The main reason that I personally don't go for class-based resource is that when running the unit test locally one have to start a new session for each run. I think this is solved in PS Core, but not Windows PowerShell.
I personally don't see that class-based resource give any benefit (other than the code are written a bit different).
But when can use DSC in PS Core then I want to be able to all in with class-based resource, or maybe by then there is a third alternative to writing DSC resources. 😄
from dscresource.template.
My preference is also to write MOF-based DSC resources, but I think we should not force our old ways if it's just personal preferences. ;)
Yes you can mix both Class & MOF based, there's a slight formatting issue on the MSFT docs that I need to submit a fix for: here's a better illustration.
Creating the MOF is adding extra complexity that new-comers could avoid, and some would-be-contributors might just be more familiar with the Class paradigm than PowerShell Advanced Functions.
I know a few organisations that have been writing Class based DSC Resources, so we should illustrate how to do it here, although that's probably going on the back burner. We should have a standard they could adhere to so that eventually they can contribute to the Resource Kit, and we can test against.
I'm not sure I remember the testing issue you mention. I can see when you dot source a class, but here you would do InModuleScope
right?
from dscresource.template.
Nope, we should not force it because of personal preference. ;)
Here the problem of testing class-based resource pester/Pester#797. I have not tested for a while, so it can be resolved in latest Windows PowerShell.
from dscresource.template.
Well, if we want to try this out and see what bubbles up, maybe migrating WmiNamespaceSecurity to ComputerManagementDsc is one way to check this out. However, ComputerManagementDsc is Auto-documentation and I'm fairly sure the Auto-documentation code would need to be updated to support Class based resources (do-able I'm sure). But that might be the opportunity to start identifying these challenges.
from dscresource.template.
Related Issues (20)
- Create dev branch and make it the default branch for PRs
- Discussion: Add Optional files for Autodocumentation Wiki Repos HOT 1
- Add *.exe as binary to .gitattributes in Template
- Integration test 'Should return $true when Test-DscConfiguration is run' does not fail HOT 1
- Common localization messages HOT 3
- Mandatory Parameters for get-targetresource HOT 3
- How TargetResource functions should be used discussion HOT 3
- DscResource.LocalizationHelper Module is misnamed HOT 7
- Suggest moving TEMPLATE_README.md to the Wiki HOT 1
- Add Opt-in to Common Tests - Validate Localization
- Common Verbose logging and standards HOT 2
- Update indentation style in settings.json (VS Code formatting) HOT 6
- Using .json with Integration tests does not work
- Unit Test Template: Remove unnecessary comment
- Connect Codecov to DscResource.Template
- Connect AppVeyor to this repo
- Minor typos in unit test template HOT 1
- Keep the old change log history HOT 1
- Update GitHub PR template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dscresource.template.