File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
powershell-adapter/psDscAdapter Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ function Invoke-DscCacheRefresh {
75
75
else {
76
76
" Checking cache for stale PSModulePath" | Write-DscTrace
77
77
78
- $m = $env: PSModulePath -split [IO.Path ]::PathSeparator | % { Get-ChildItem - Directory - Path $_ - Depth 1 - ea SilentlyContinue }
78
+ $m = $env: PSModulePath -split [IO.Path ]::PathSeparator | ForEach-Object { Get-ChildItem - Directory - Path $_ - Depth 1 - ErrorAction Ignore }
79
79
80
80
$hs_cache = [System.Collections.Generic.HashSet [string ]]($cache.PSModulePaths )
81
81
$hs_live = [System.Collections.Generic.HashSet [string ]]($m.FullName )
@@ -106,21 +106,16 @@ function Invoke-DscCacheRefresh {
106
106
107
107
if (-not ($file_LastWriteTime.Equals ($cache_LastWriteTime ))) {
108
108
" Detected stale cache entry '$ ( $_.Name ) '" | Write-DscTrace
109
- $refreshCache = $true
109
+ $namedModules .Add ( $cacheEntry .DscResourceInfo.ModuleName )
110
110
break
111
111
}
112
112
}
113
113
else {
114
114
" Detected non-existent cache entry '$ ( $_.Name ) '" | Write-DscTrace
115
- $refreshCache = $true
115
+ $namedModules .Add ( $cacheEntry .DscResourceInfo.ModuleName )
116
116
break
117
117
}
118
118
}
119
-
120
- if ($refreshCache ) {
121
- $namedModules.Add ($cacheEntry.DscResourceInfo.ModuleName )
122
- $refreshCache = $false
123
- }
124
119
}
125
120
}
126
121
if ($namedModules.Count -gt 0 ) {
You can’t perform that action at this time.
0 commit comments