From 0cbaac536c7dbde3c7e3e00c09228adb1c6a7533 Mon Sep 17 00:00:00 2001 From: Lorne Sepaugh <9103519+sepaugh@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:32:48 -0400 Subject: [PATCH] Update Save-KbUpdate.ps1 On line 234, the "Sort-Object -Unique" would often return only one result from a multiple object result from Get-KBUpdate. For example, testing KB5035285, which returns 7 files, would only actually download one of the files. Most of the properties were the same across the board, so only one was selected as "unique". Set the unique sort to the UpdateID, which should actually be unique across each file. --- public/Save-KbUpdate.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/Save-KbUpdate.ps1 b/public/Save-KbUpdate.ps1 index ed6728b..2e42960 100644 --- a/public/Save-KbUpdate.ps1 +++ b/public/Save-KbUpdate.ps1 @@ -231,7 +231,7 @@ function Save-KbUpdate { $inputobjects += Get-KbUpdate @params } - $inputobjects = $inputobjects | Sort-Object -Unique + $inputobjects = $inputobjects | Sort-Object -Property UpdateId -Unique foreach ($object in $inputobjects) { if ($Architecture) { @@ -312,4 +312,4 @@ function Save-KbUpdate { } Write-Progress -Activity "Queuing up downloads" -Completed } -} \ No newline at end of file +}