Add a default Ensure enum to PSDesiredStateConfiguration #84
michaeltlombardi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current implementation suggestion for class-based DSC Resources requires every module with DSC Resources to redefine their own enum for Ensure, even if it uses the most common pattern (
Present
andAbsent
).Proposal
I propose that the PSDesiredStateConfiguration module export a default ensure enum (possibly with a more unique name, like DscBasicEnsure) with the values
Present
andAbsent
, allowing DSC Resource developers to reuse that enum instead of redeclaring it. If an alternate implementation is required, the developer could still implement their own. Since all DSC Resources expect to be invoked viaInvoke-DscResource
(requiring PSDesiredStateConfiguration to be loaded), this should not be a blocker. Further, this implementation would be backwards compatible (I believe) and existing DSC Resources could opt into using it instead of their reimplementation.Beta Was this translation helpful? Give feedback.
All reactions