Skip to content

Commit 2b9a32f

Browse files
committed
Fix remarks
1 parent ece54f4 commit 2b9a32f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

powershell-adapter/psDscAdapter/psDscAdapter.psm1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function FindAndParseResourceDefinitions {
101101
return
102102
}
103103

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))) {
105105
return
106106
}
107107

@@ -159,9 +159,8 @@ function LoadPowerShellClassResourcesFromModule {
159159
"Loading resources from module '$($moduleInfo.Path)'" | Write-DscTrace -Operation Trace
160160

161161
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)) {
165164
"RootModule is neither psm1 nor ps1 '$($moduleInfo.RootModule)'" | Write-DscTrace -Operation Trace
166165
return [System.Collections.Generic.List[DscResourceInfo]]::new()
167166
}
@@ -326,7 +325,7 @@ function Invoke-DscCacheRefresh {
326325

327326
# fill in resource files (and their last-write-times) that will be used for up-do-date checks
328327
$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 | % {
330329
$lastWriteTimes.Add($_.FullName, $_.LastWriteTime)
331330
}
332331

@@ -577,4 +576,4 @@ class DscResourceInfo {
577576
[string] $ImplementedAs
578577
[string] $CompanyName
579578
[System.Collections.Generic.List[DscResourcePropertyInfo]] $Properties
580-
}
579+
}

0 commit comments

Comments
 (0)