ryan-jan/MSCatalog

Saving Driver updates where there are many from the same version

Opened this issue · 2 comments

I'm having issues while using Save-MSCatalogUpdate when selecting the first item in the array. The process is asking me whether to save All files or select an individual Id (I don't know which Id is referring to), and when selecting All nothing happen and NO file is saved on the directory.

PS C:\User\> $Updates = Get-MSCatalogUpdate -Search "MT7921" -AllPages | Where-Object {$_.Title -like "*3.3.0*"}
PS C:\User\> echo $Updates[0]

Title                            Products                                                                                                             Classification       LastUpdated Size
-----                            --------                                                                                                             --------------       ----------- ----
MediaTek, Inc. - Net - 3.3.0.540 Windows 10,  Vibranium and later,  Servicing Drivers, Windows 10,  Vibranium and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/05/07  6.6 MB

PS C:\User> echo $Updates

Title                            Products                                                                                                                               Classification       LastUpdated Size
-----                            --------                                                                                                                               --------------       ----------- ----
MediaTek, Inc. - Net - 3.3.0.540 Windows 10,  Vibranium and later,  Servicing Drivers, Windows 10,  Vibranium and later,  Upgrade & Servicing Drivers                   Drivers (Networking) 2022/05/07  6.6 …
MediaTek, Inc. - Net - 3.3.0.467 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/02/24  6.5 …
MediaTek, Inc. - Net - 3.3.0.443 Windows - Client,  version 21H2 and later,  Servicing Drivers                                                                          Drivers (Networking) 2022/01/27  6.5 …
MediaTek, Inc. - Net - 3.3.0.443 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/01/27  6.5 …
MediaTek, Inc. - Net - 3.3.0.442 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.443 Windows 10,  Vibranium and later,  Servicing Drivers, Windows 10,  Vibranium and later,  Upgrade & Servicing Drivers                   Drivers (Networking) 2022/01/27  6.5 …
MediaTek, Inc. - Net - 3.3.0.442 Windows - Client,  version 21H2 and later,  Servicing Drivers                                                                          Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.442 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.442 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.442 Windows 10,  Vibranium and later,  Servicing Drivers, Windows 10,  Vibranium and later,  Upgrade & Servicing Drivers                   Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.443 Windows 10,  Vibranium and later,  Servicing Drivers                                                                                   Drivers (Networking) 2022/01/27  6.5 …
MediaTek, Inc. - Net - 3.3.0.442 Windows 10,  Vibranium and later,  Servicing Drivers, Windows 10,  Vibranium and later,  Upgrade & Servicing Drivers                   Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.442 Windows 10,  Vibranium and later,  Servicing Drivers                                                                                   Drivers (Networking) 2022/01/27  6.4 …
MediaTek, Inc. - Net - 3.3.0.426 Windows 10,  Vibranium and later,  Servicing Drivers                                                                                   Drivers (Networking) 2022/01/14  5.0 …
MediaTek, Inc. - Net - 3.3.0.426 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing Drivers Drivers (Networking) 2022/01/14  5.0 …
MediaTek, Inc. - Net - 3.3.0.426 Windows - Client,  version 21H2 and later,  Servicing Drivers                                                                          Drivers (Networking) 2022/01/14  5.0 …
MediaTek, Inc. - Net - 3.3.0.347 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client S,  version 21H2 and later,  Servicing Drivers         Drivers (Networking) 2021/11/18  4.9 …
MediaTek, Inc. - Net - 3.3.0.347 Windows 10,  Vibranium and later,  Servicing Drivers, Windows 10 S,  Vibranium and later,  Servicing Drivers                           Drivers (Networking) 2021/11/18  4.9 …

PS C:\Users\emea_jpavon> Save-MSCatalogUpdate -Update $Updates[0] -Destination ".\"
Id  FileName
--  --------
Multiple files exist for this update. Enter the Id of the file to download or 'A' to download all files.: A
PS C:\User> dir *.cap
PS C:\User> 

@onlywifi
Downloading certain files doesn't work because they can't be found on existing hosting servers. You can spot this behavior as empty table with no ID and FileName.

The problem is RegEx syntax in Get-UpdateLinks function - you can find this function in module's Private folder in it's own file (Get-UpdateLinks.ps1).
If you update the RegEx, downloading problem should be resolved (at least until next time when MS introduces new hosting servers). My current working RegEx:
$Regex = "(http[s]?://(?:[a-z,.]dl.delivery.mp.microsoft.com|(?:catalog.s.)?download.windowsupdate.com)/[^\'\""])"

@JozeMarkic in my case the RegEx in my "Get-UpdateLinks.ps1" script looks like the one you set, but then I get no driver downloaded when using it. See the whole process below:

PS C:\windows\system32> $Updates = Get-MSCatalogUpdate -Search "Fastconnect 6900" -AllPages | Where-Object {$_.Title -like "**2.0*"}
PS C:\windows\system32> echo $Updates
Title                                                    Products
-----                                                    --------
Qualcomm Atheros Communications - Bluetooth - 2.0.0.1120 Windows 11 Client,  version 22H2 and later,  Servicing Drivers, Windows 11 Client,  version 22H2 and later,  Upgrade & Servicin...
Qualcomm Atheros Communications - Bluetooth - 2.0.0.1120 Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing ...
Qualcomm Communications Inc. - Net - 2.0.0.1036          Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing ...
Qualcomm Communications Inc. - Net - 2.0.0.1036          Windows 11 Client,  version 22H2 and later,  Servicing Drivers, Windows 11 Client,  version 22H2 and later,  Upgrade & Servicin...
Qualcomm Communications Inc. - Net - 2.0.0.1016          Windows 11 Client,  version 22H2 and later,  Servicing Drivers, Windows 11 Client,  version 22H2 and later,  Upgrade & Servicin...
Qualcomm Communications Inc. - Net - 2.0.0.1016          Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing ...
Qualcomm Communications Inc. - Net - 2.0.0.1016          Windows 11 Client,  version 22H2 and later,  Servicing Drivers, Windows 11 Client,  version 22H2 and later,  Upgrade & Servicin...
Qualcomm Communications Inc. - Net - 2.0.0.1016          Windows - Client,  version 21H2 and later,  Servicing Drivers, Windows - Client,  version 21H2 and later,  Upgrade & Servicing ...
Qualcomm Atheros Communications - Bluetooth - 2.0.0.1036 Windows 11 Client,  version 22H2 and later,  Servicing Drivers, Windows 11 Client,  version 22H2 and later,  Upgrade & Servicin...
(...)
PS C:\windows\system32> echo $Updates[29]

Title                                          Products                                                                                                Classification       LastUpdated Siz
                                                                                                                                                                                        e
-----                                          --------                                                                                                --------------       ----------- ---
Qualcomm Communications Inc. - Net - 2.0.0.775 Windows 10 and later drivers, Windows Server Drivers...                                                 Drivers (Networking) 2022/10/10  3.2

PS C:\windows\system32> Save-MSCatalogUpdate -Update $Updates[29] -Destination "c:\"
Id  FileName
--  --------
Multiple files exist for this update. Enter the Id of the file to download or 'A' to download all files.: A

And then, nothing is downloaded at all.
To me this seems like an error in the "Save-MSCatalogUpdate.ps1" script.
image