@@ -25,13 +25,13 @@ For more information about DSC Resources, see [DSC Resources][1].
2525## Folder structure for a class Resource
2626
2727To implement a DSC Resource with a PowerShell class, create the following folder structure. The
28- class is defined in ` MyDscResource .psm1` and the module manifest is defined in ` MyDscResource .psd1` .
28+ class is defined in ` NewFile .psm1` and the module manifest is defined in ` NewFile .psd1` .
2929
3030``` text
3131$env:ProgramFiles\WindowsPowerShell\Modules (folder)
32- |- MyDscResource (folder)
33- MyDscResource .psm1
34- MyDscResource .psd1
32+ |- NewFile (folder)
33+ NewFile .psm1
34+ NewFile .psd1
3535```
3636
3737## Create the class
@@ -61,7 +61,7 @@ follows.
6161[string] $content
6262
6363[DscProperty(NotConfigurable)]
64- [MyDscResourceReason []] $Reasons
64+ [NewFileReason []] $Reasons
6565```
6666
6767Notice that the properties are modified by attributes. The meaning of the attributes is as follows:
@@ -90,7 +90,7 @@ If you would like to include a new type with defined properties that you can use
9090DSC Resource, create a class with property types as described before.
9191
9292``` powershell
93- class MyDscResourceReason {
93+ class NewFileReason {
9494 [DscProperty()]
9595 [string] $Code
9696
@@ -100,7 +100,7 @@ class MyDscResourceReason {
100100```
101101
102102> [ !NOTE]
103- > The ` MyDscResourceReason ` class is declared here with the module's name as a prefix. While you can
103+ > The ` NewFileReason ` class is declared here with the module's name as a prefix. While you can
104104> give embedded classes any name, if two or more modules define a class with the same name and are
105105> both used in a configuration, PowerShell raises an exception.
106106>
@@ -134,10 +134,10 @@ function Get-File {
134134 [String]$content
135135 )
136136
137- $fileContent = [MyDscResourceReason ]::new()
137+ $fileContent = [NewFileReason ]::new()
138138 $fileContent.code = 'file:file:content'
139139
140- $filePresent = [MyDscResourceReason ]::new()
140+ $filePresent = [NewFileReason ]::new()
141141 $filePresent.code = 'file:file:path'
142142
143143 $ensureReturn = 'Absent'
@@ -309,7 +309,7 @@ enum ensure {
309309 errors raised when multiple modules with DSC Resources define the
310310 Reasons property for reporting when they're out-of-state.
311311#>
312- class MyDscResourceReason {
312+ class NewFileReason {
313313 [DscProperty()]
314314 [string] $Code
315315
@@ -332,10 +332,10 @@ function Get-File {
332332 [String]$content
333333 )
334334
335- $fileContent = [MyDscResourceReason ]::new()
335+ $fileContent = [NewFileReason ]::new()
336336 $fileContent.code = 'file:file:content'
337337
338- $filePresent = [MyDscResourceReason ]::new()
338+ $filePresent = [NewFileReason ]::new()
339339 $filePresent.code = 'file:file:path'
340340
341341 $ensureReturn = 'Absent'
@@ -502,7 +502,7 @@ class NewFile {
502502 about the Resource when it is present.
503503 #>
504504 [DscProperty(NotConfigurable)]
505- [MyDscResourceReason []] $Reasons
505+ [NewFileReason []] $Reasons
506506
507507 <#
508508 This method is equivalent of the Get-TargetResource script function.
@@ -628,9 +628,9 @@ A module can define multiple class-based DSC Resources. You need to declare all
628628
629629``` text
630630$env:ProgramFiles\PowerShell\Modules (folder)
631- |- MyDscResource (folder)
632- |- MyDscResource .psm1
633- MyDscResource .psd1
631+ |- NewFile (folder)
632+ |- NewFile .psm1
633+ NewFile .psd1
634634```
635635
636636## See Also
0 commit comments