Skip to content

Commit 11227b3

Browse files
committed
add rule documents for dsc rules
1 parent 61f7520 commit 11227b3

4 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ReturnCorrectTypeDSCFunctions
2+
**Severity Level: Error**
3+
4+
5+
##Description
6+
7+
Set function in DSC class and Set-TargetResource in DSC resource must not return anything. Get function in DSC class must return an instance of the DSC class and Get-TargetResource function in DSC resource must return a hashtable. Test function in DSC class and Get-TargetResource function in DSC resource must return a boolean.
8+
9+
10+
##How to Fix
11+
12+
To fix a violation of this rule, please correct the return type of the Get/Set/Test-TargetResource functions in DSC resource.
13+
14+
15+
##Example
16+
17+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#UseIdenticalMandatoryParametersDSC
2+
**Severity Level: Error**
3+
4+
5+
##Description
6+
7+
The Get/Test/Set TargetResource functions of DSC Resource must have the same mandatory parameters
8+
9+
10+
##How to Fix
11+
12+
To fix a violation of this rule, please correct the mandatory parameters for Get/Set/Test functions in DSC resource.
13+
14+
15+
##Example
16+
17+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#UseIdenticalParametersDSC
2+
**Severity Level: Error**
3+
4+
5+
##Description
6+
7+
The Test and Set-TargetResource functions of DSC Resource must have the same parameters.
8+
9+
10+
##How to Fix
11+
12+
To fix a violation of this rule, please correct the mandatory parameters for Test and Set-TargetResource functions in DSC resource.
13+
14+
15+
##Example
16+
17+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#UseStandardDSCFunctionsInResource
2+
**Severity Level: Error**
3+
4+
5+
##Description
6+
7+
DSC Resource must implement Get, Set and Test-TargetResource functions. DSC Class must implement Get, Set and Test functions.
8+
9+
10+
##How to Fix
11+
12+
To fix a violation of this rule, please add the missing functions to the resouce.
13+
14+
15+
##Example
16+

0 commit comments

Comments
 (0)