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 {
7575 else {
7676 " Checking cache for stale PSModulePath" | Write-DscTrace
7777
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 }
7979
8080 $hs_cache = [System.Collections.Generic.HashSet [string ]]($cache.PSModulePaths )
8181 $hs_live = [System.Collections.Generic.HashSet [string ]]($m.FullName )
@@ -106,21 +106,16 @@ function Invoke-DscCacheRefresh {
106106
107107 if (-not ($file_LastWriteTime.Equals ($cache_LastWriteTime ))) {
108108 " Detected stale cache entry '$ ( $_.Name ) '" | Write-DscTrace
109- $refreshCache = $true
109+ $namedModules .Add ( $cacheEntry .DscResourceInfo.ModuleName )
110110 break
111111 }
112112 }
113113 else {
114114 " Detected non-existent cache entry '$ ( $_.Name ) '" | Write-DscTrace
115- $refreshCache = $true
115+ $namedModules .Add ( $cacheEntry .DscResourceInfo.ModuleName )
116116 break
117117 }
118118 }
119-
120- if ($refreshCache ) {
121- $namedModules.Add ($cacheEntry.DscResourceInfo.ModuleName )
122- $refreshCache = $false
123- }
124119 }
125120 }
126121 if ($namedModules.Count -gt 0 ) {
You can’t perform that action at this time.
0 commit comments