@@ -348,7 +348,7 @@ function Invoke-DscCacheRefresh {
348348
349349 # fill in resource files (and their last-write-times) that will be used for up-do-date checks
350350 $lastWriteTimes = @ {}
351- Get-ChildItem - Recurse - File - Path $dscResource.ParentPath - Include " *.ps1" , " *.psd1" , " *.psm1" , " *.mof" - ErrorAction Ignore | ForEach-Object {
351+ Get-ChildItem - Recurse - File - LiteralPath $dscResource.ParentPath - Include " *.ps1" , " *.psd1" , " *.psm1" , " *.mof" - ErrorAction Ignore | ForEach-Object {
352352 $lastWriteTimes.Add ($_.FullName , $_.LastWriteTime )
353353 }
354354
@@ -361,15 +361,15 @@ function Invoke-DscCacheRefresh {
361361
362362 [dscResourceCache ]$cache = [dscResourceCache ]::new()
363363 $cache.ResourceCache = $dscResourceCacheEntries
364- $m = $env: PSModulePath -split [IO.Path ]::PathSeparator | ForEach-Object { Get-ChildItem - Directory - Path $_ - Depth 1 - ErrorAction Ignore }
364+ $m = $env: PSModulePath -split [IO.Path ]::PathSeparator | ForEach-Object { Get-ChildItem - Directory - LiteralPath $_ - Depth 1 - ErrorAction Ignore }
365365 $cache.PSModulePaths = $m.FullName
366366 $cache.CacheSchemaVersion = $script :CurrentCacheSchemaVersion
367367
368368 # save cache for future use
369369 # TODO: replace this with a high-performance serializer
370370 Write-Debug - Debug (" Saving Get-DscResource cache to '$cacheFilePath '" )
371371 $jsonCache = $cache | ConvertTo-Json - Depth 90
372- New-Item - Force - Path $cacheFilePath - Value $jsonCache - Type File | Out-Null
372+ New-Item - Force - LiteralPath $cacheFilePath - Value $jsonCache - Type File | Out-Null
373373 }
374374
375375 return $dscResourceCacheEntries
0 commit comments