Skip to content

Commit

Permalink
Merge pull request PowerShell#478 from anmenaga/buildfix
Browse files Browse the repository at this point in the history
WinPSAdapter fix
  • Loading branch information
SteveL-MSFT authored Jul 2, 2024
2 parents b017179 + 7dd51b8 commit f722880
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions powershell-adapter/psDscAdapter/win_psDscAdapter.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,13 @@ function Invoke-DscCacheRefresh {
# if there is nothing in the cache file - refresh cache
$refreshCache = $true
"Filtered DscResourceCache cache is empty" | Write-DscTrace
}
else
{
"Checking cache for stale entries" | Write-DscTrace

foreach ($cacheEntry in $dscResourceCacheEntries) {
#"Checking cache entry '$($cacheEntry.Type) $($cacheEntry.LastWriteTimes)'" | Write-DscTrace -Operation Trace

$cacheEntry.LastWriteTimes.PSObject.Properties | ForEach-Object {

if (-not ((Get-Item $_.Name).LastWriteTime.Equals([DateTime]$_.Value)))
{
"Detected stale cache entry '$($_.Name)'" | Write-DscTrace
$refreshCache = $true
break
}
}

"Filtered DscResourceCache cache is empty" | Write-DscTrace
}
else
{
"Checking cache for stale entries" | Write-DscTrace

foreach ($cacheEntry in $dscResourceCacheEntries) {
"Checking cache entry '$($cacheEntry.Type) $($cacheEntry.LastWriteTimes)'" | Write-DscTrace -Operation Trace
#"Checking cache entry '$($cacheEntry.Type) $($cacheEntry.LastWriteTimes)'" | Write-DscTrace -Operation Trace

$cacheEntry.LastWriteTimes.PSObject.Properties | ForEach-Object {

Expand Down

0 comments on commit f722880

Please sign in to comment.