GithubHelp home page GithubHelp logo

Comments (5)

gaelcolas avatar gaelcolas commented on May 10, 2024 1

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.

johlju avatar johlju commented on May 10, 2024

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.

gaelcolas avatar gaelcolas commented on May 10, 2024

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.

johlju avatar johlju commented on May 10, 2024

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.

PlagueHO avatar PlagueHO commented on May 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.