You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The properties you can define in configuration settings.
6
+
The [DscProperty(...)] attribute has a few possible values:
7
+
- <empty>: Nothing specified makes this an optional property you can leave empty when defining the configuration setting.
8
+
- Mandatory: A Property that MUST be set when defining the configuration setting.
9
+
- Key: The property is considered as the identifier for the resource modified. It is mandatory AND there cannot be multiple configuration entries with the same value for this property!
10
+
- NotConfigurable: ReadOnly property. Mostly used for integration into Azure Guest Configurations
11
+
12
+
Example Properties:
13
+
14
+
[DscProperty(Key)]
15
+
[string]$Path
16
+
17
+
[DscProperty(Mandatory)]
18
+
[string]$Text
19
+
20
+
[DscProperty(Mandatory)]
21
+
[Ensure]$Ensure
22
+
#>
23
+
24
+
[DscProperty(NotConfigurable)]
25
+
[Reason[]] $Reasons# Reserved for Azure Guest Configuration
26
+
#endregion DSC Properties
27
+
28
+
[void]Set() {
29
+
# Apply Desired State
30
+
}
31
+
32
+
[þnameþ]Get() {
33
+
# Return current actual state
34
+
}
35
+
36
+
[bool]Test() {
37
+
# Check whether current state = desired state
38
+
}
39
+
40
+
[Hashtable] GetConfigurableDscProperties()
41
+
{
42
+
# This method returns a hashtable of properties with two special workarounds
43
+
# The hashtable will not include any properties marked as "NotConfigurable"
44
+
# Any properties with a ValidateSet of "True","False" will beconverted to Boolean type
45
+
# The intent is to simplify splatting to functions
0 commit comments