From 70a1d545c72c676ce5e5734a4e3abe8235bb9a1f Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 1 Jul 2024 20:34:58 -0700 Subject: [PATCH 1/2] Emprty line --- powershell-adapter/psDscAdapter/psDscAdapter.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/powershell-adapter/psDscAdapter/psDscAdapter.psm1 b/powershell-adapter/psDscAdapter/psDscAdapter.psm1 index 53d7dda4..a8ea8008 100644 --- a/powershell-adapter/psDscAdapter/psDscAdapter.psm1 +++ b/powershell-adapter/psDscAdapter/psDscAdapter.psm1 @@ -251,6 +251,7 @@ function Invoke-DscCacheRefresh { } else { $dscResourceCacheEntries = $cache.ResourceCache + if ($dscResourceCacheEntries.Count -eq 0) { # if there is nothing in the cache file - refresh cache $refreshCache = $true From 7dd51b857f79f598498964074588f6c62a179510 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 2 Jul 2024 07:17:08 -0700 Subject: [PATCH 2/2] Fixed bad merge --- .../psDscAdapter/psDscAdapter.psm1 | 1 - .../psDscAdapter/win_psDscAdapter.psm1 | 21 +------------------ 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/powershell-adapter/psDscAdapter/psDscAdapter.psm1 b/powershell-adapter/psDscAdapter/psDscAdapter.psm1 index a8ea8008..53d7dda4 100644 --- a/powershell-adapter/psDscAdapter/psDscAdapter.psm1 +++ b/powershell-adapter/psDscAdapter/psDscAdapter.psm1 @@ -251,7 +251,6 @@ function Invoke-DscCacheRefresh { } else { $dscResourceCacheEntries = $cache.ResourceCache - if ($dscResourceCacheEntries.Count -eq 0) { # if there is nothing in the cache file - refresh cache $refreshCache = $true diff --git a/powershell-adapter/psDscAdapter/win_psDscAdapter.psm1 b/powershell-adapter/psDscAdapter/win_psDscAdapter.psm1 index c4eadac9..19feb784 100644 --- a/powershell-adapter/psDscAdapter/win_psDscAdapter.psm1 +++ b/powershell-adapter/psDscAdapter/win_psDscAdapter.psm1 @@ -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 {