@@ -101,7 +101,7 @@ function FindAndParseResourceDefinitions {
101
101
return
102
102
}
103
103
104
- if (([ System.IO.Path ]::GetExtension( $filePath ) -ne " .psm1 " ) -and ([System.IO.Path ]::GetExtension($filePath ) -ne " .ps1 " )) {
104
+ if (" .psm1 " , " .ps1 " -notcontains ([System.IO.Path ]::GetExtension($filePath ))) {
105
105
return
106
106
}
107
107
@@ -159,9 +159,8 @@ function LoadPowerShellClassResourcesFromModule {
159
159
" Loading resources from module '$ ( $moduleInfo.Path ) '" | Write-DscTrace - Operation Trace
160
160
161
161
if ($moduleInfo.RootModule ) {
162
- if (([System.IO.Path ]::GetExtension($moduleInfo.RootModule ) -ne " .psm1" ) -and
163
- ([System.IO.Path ]::GetExtension($moduleInfo.RootModule ) -ne " .ps1" ) -and
164
- (-not $z.NestedModules )) {
162
+ if (" .psm1" , " .ps1" -notcontains ([System.IO.Path ]::GetExtension($moduleInfo.RootModule )) -and
163
+ (-not $moduleInfo.NestedModules )) {
165
164
" RootModule is neither psm1 nor ps1 '$ ( $moduleInfo.RootModule ) '" | Write-DscTrace - Operation Trace
166
165
return [System.Collections.Generic.List [DscResourceInfo ]]::new()
167
166
}
@@ -326,7 +325,7 @@ function Invoke-DscCacheRefresh {
326
325
327
326
# fill in resource files (and their last-write-times) that will be used for up-do-date checks
328
327
$lastWriteTimes = @ {}
329
- Get-ChildItem - Recurse - File - Path $dscResource.ParentPath - Include " *.ps1" , " *.psd1" , " *psm1" , " *.mof" - ea Ignore | % {
328
+ Get-ChildItem - Recurse - File - Path $dscResource.ParentPath - Include " *.ps1" , " *.psd1" , " *. psm1" , " *.mof" - ea Ignore | % {
330
329
$lastWriteTimes.Add ($_.FullName , $_.LastWriteTime )
331
330
}
332
331
@@ -577,4 +576,4 @@ class DscResourceInfo {
577
576
[string ] $ImplementedAs
578
577
[string ] $CompanyName
579
578
[System.Collections.Generic.List [DscResourcePropertyInfo ]] $Properties
580
- }
579
+ }
0 commit comments