diff --git a/PSFramework/PSFramework.psd1 b/PSFramework/PSFramework.psd1 index d3771e9..8c83048 100644 --- a/PSFramework/PSFramework.psd1 +++ b/PSFramework/PSFramework.psd1 @@ -4,7 +4,7 @@ RootModule = 'PSFramework.psm1' # Version number of this module. - ModuleVersion = '1.14.438' + ModuleVersion = '1.14.441' # ID used to uniquely identify this module GUID = '8028b914-132b-431f-baa9-94a6952f21ff' diff --git a/PSFramework/bin/PSFramework.dll b/PSFramework/bin/PSFramework.dll index 93f16f0..5caef99 100644 Binary files a/PSFramework/bin/PSFramework.dll and b/PSFramework/bin/PSFramework.dll differ diff --git a/PSFramework/bin/PSFramework.pdb b/PSFramework/bin/PSFramework.pdb index c01d80d..e130183 100644 Binary files a/PSFramework/bin/PSFramework.pdb and b/PSFramework/bin/PSFramework.pdb differ diff --git a/PSFramework/changelog.md b/PSFramework/changelog.md index 6d3f68c..3e9780c 100644 --- a/PSFramework/changelog.md +++ b/PSFramework/changelog.md @@ -1,5 +1,11 @@ # CHANGELOG +## 1.14.441 (2026-06-03) + +- Fix: New-PSFCache - timer only removes one expired item at a time +- Fix: TabExpansion - Trained results do not show with cached completion +- Fix: TabExpansion - Trained results do not duplicate equal cached results + ## 1.14.438 (2026-05-31) - New: New-PSFCache - creates a configurable in-memory cache. diff --git a/PSFramework/internal/scripts/teppSimpleCompleter.ps1 b/PSFramework/internal/scripts/teppSimpleCompleter.ps1 index 0472cc2..e05adb8 100644 --- a/PSFramework/internal/scripts/teppSimpleCompleter.ps1 +++ b/PSFramework/internal/scripts/teppSimpleCompleter.ps1 @@ -149,10 +149,10 @@ if (-not $scriptContainer.ShouldExecute) { if ($scriptContainer.Trained.Count -gt 0) { - $allItems = @($scriptContainer.LastCompletion) + ($scriptContainer.Trained | ConvertTo-TeppCompletionEntry) + $allItems = @($scriptContainer.LastCompletion) + ($scriptContainer.Trained | ConvertTo-TeppCompletionEntry | Where-Object { $_.Text -notin $scriptContainer.LastCompletion.Text }) } else { $allItems = $scriptContainer.LastCompletion } - $allResults = foreach ($item in ($scriptContainer.LastCompletion | Where-Object Text -Match $scriptContainer.GetPattern($wordToComplete) | Sort-Object @sortParam)) { + $allResults = foreach ($item in ($allItems | Where-Object Text -Match $scriptContainer.GetPattern($wordToComplete) | Sort-Object @sortParam)) { New-PSFTeppCompletionResult -CompletionText $item.Text -ToolTip $item.ToolTip -ListItemText $item.ListItemText -AlwaysQuote:$alwaysQuote } diff --git a/library/PSFramework/Caching/CacheBase.cs b/library/PSFramework/Caching/CacheBase.cs index aa3fc4b..39ec408 100644 --- a/library/PSFramework/Caching/CacheBase.cs +++ b/library/PSFramework/Caching/CacheBase.cs @@ -299,7 +299,10 @@ private void Clean(object source, ElapsedEventArgs e) { try { - foreach (CachedData entry in base.Values) + CachedData[] tempData = new CachedData[base.Values.Count]; + base.Values.CopyTo(tempData, 0); + + foreach (CachedData entry in tempData) if (entry.IsExpired) entry.DisposeIfExpired(); } diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..11a7831 --- /dev/null +++ b/notes.md @@ -0,0 +1,10 @@ +# Notes + +> PSFCache + ++ Remove does not work + +> Tab Completion + ++ CacheDuration disables manually trained values ++ Mixing results with trained values leads to duplicates