@@ -234,10 +234,10 @@ function Invoke-DscCacheRefresh {
234
234
}
235
235
236
236
$dscResourceCacheEntries.Add ([dscResourceCacheEntry ]@ {
237
- Type = " $moduleName /$ ( $dscResource.Name ) "
238
- DscResourceInfo = $DscResourceInfo
239
- LastWriteTimes = $lastWriteTimes
240
- })
237
+ Type = " $moduleName /$ ( $dscResource.Name ) "
238
+ DscResourceInfo = $DscResourceInfo
239
+ LastWriteTimes = $lastWriteTimes
240
+ })
241
241
}
242
242
243
243
if ($namedModules.Count -gt 0 ) {
@@ -578,14 +578,14 @@ function GetClassBasedProperties {
578
578
return @ (' get' , ' set' , ' test' )
579
579
}
580
580
581
- $module = Get-ChildItem - Path ( Split-Path $filePath - Parent) - Filter * .psm1 - File | Select-Object - First 1 - ExpandProperty FullName
581
+ $module = Import-Module $filePath - PassThru - Force - ErrorAction Ignore
582
582
583
583
$properties = [System.Collections.Generic.List [DscResourcePropertyInfo ]]::new()
584
584
585
- if (Test-Path $module - ErrorAction Ignore) {
585
+ if (Test-Path $module.Path - ErrorAction Ignore) {
586
586
[System.Management.Automation.Language.Token []] $tokens = $null
587
587
[System.Management.Automation.Language.ParseError []] $errors = $null
588
- $ast = [System.Management.Automation.Language.Parser ]::ParseFile($module , [ref ]$tokens , [ref ]$errors )
588
+ $ast = [System.Management.Automation.Language.Parser ]::ParseFile($module.Path , [ref ]$tokens , [ref ]$errors )
589
589
foreach ($e in $errors ) {
590
590
$e | Out-String | Write-DscTrace - Operation Error
591
591
}
0 commit comments