Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DSC Class Resource Template.
enum Ensure
enum List
First = 1
Second = 2
Last = 999
class Template
[String] $Name
[Ensure] $Ensure
[String] $Info
[List] $List
[Template] Get()
return @{
[Bool] Test()
return $true
[Void] Set()
#Helper method to get the value from the enum
[Int]SettingToValue([String] $Setting) {
return ([List]::$Setting).value__
#Helper method to get the key from the enum
[String]ValueToSetting([int] $Value) {
return [List].GetEnumName($Value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.