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
This removes the constraint that a parameter needs to be declared `mandatory` in the `Get/Test/Set` functions if any of them declares the parameter as `mandatory`.
These DSC functions are supposed to take in parameters that declared in the corresponding mof file and only the parameters that are declared as `key` or `required` should be mandatory in all the three functions.
Copy file name to clipboardExpand all lines: RuleDocumentation/UseIdenticalMandatoryParametersForDSC.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,11 @@
4
4
5
5
## Description
6
6
7
-
For script based DSC resources the `Get-TargetResource`, `Test-TargetResource` and `Set-TargetResource` functions:
8
-
9
-
1. If a parameter is declared as `mandatory` in any of the `Get/Set/Test` functions, then it should be a mandatory parameter in all the three functions.
10
-
1. If a property is declared with attributes `Key` of `Required` in a mof file, then is should be present as a mandatory parameter in the `Get/Set/Test` functions of the corresponding resource file.
7
+
For script based DSC resources, if a property is declared with attributes `Key` of `Required` in a mof file, then is should be present as a mandatory parameter in the corresponding `Get-TargetResource`, `Set-TargetResource` and `Test-TargetResource` functions.
11
8
12
9
## How
13
10
14
-
1. Make sure `Get/Set/Test` declare identical mandatory parameters.
15
-
1. Make sure all the properties with `Key` and `Required` attributes have equivalent mandatory parameters in the `Get/Set/Test` functions.
11
+
Make sure all the properties with `Key` and `Required` attributes have equivalent mandatory parameters in the `Get/Set/Test` functions.
0 commit comments