dsccommunity / UpdateServicesDsc

This module contains community maintained DSC resources for deployment and configuration of Windows Server Update Services.
MIT License
31 stars 27 forks source link

UpdateServicesServer unable to handle duplicate product name values #67

Closed rileysea closed 2 years ago

rileysea commented 3 years ago

Details of the scenario you tried and the problem that is occurring

Loading new products into an array under "UpdateServicesServer" DSC resource has failed due to WSUS now containing multiple product titles with the same name.

Verbose logs showing the problem

ERROR - An error occurred running method 'Set' in resource 'UpdateServicesServer' for resourceID '[UpdateServicesServer]UpdateServices': System.Management.Automation.MethodException: Cannot find an overload for "GetUpdateCategory" and the argument count: "1".

Suggested solution to the issue

Modify this code block to handle product names with the same title Code Reference

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Not sharing the DSC configuration, since it's an array of products. But here is the example of multiple products returned from the $AllWsusProducts = $WsusServer.GetUpdateCategories() line that is pulling duplicate product titles.

Title                                                                               Description
-----                                                                               -----------
Windows Server 2016                                                                 Windows 10 Server
Windows Server 2016                                                                 Windows Server 2016
Windows Server 2019 and later, Servicing Drivers                                    Windows Server 2019 and later, Servicing Drivers
Windows Server 2019 and later, Upgrade & Servicing Drivers                          Windows Server 2019 and later, Upgrade & Servicing Drivers
Windows Server 2019 Datacenter: Azure Edition Hotpatch                              Windows Server 2019 Datacenter: Azure Edition
Windows Server 2019                                                                 Category for Windows Server 2019
Windows Server 2019                                                                 Windows Server 2019 (RS5 Server) and above

The operating system the target node is running

OsName               : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.1490
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1490
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used

1.2.0

MartinVokurek commented 3 years ago

This seems to be the same issue as in #61

lopez1de commented 2 years ago

I still got this error in 1.2.1.