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

Added wildcard support in Products parameter of UpdateServicesServer resource #71

Closed NicolasBn closed 2 years ago

NicolasBn commented 2 years ago

Pull Request (PR) description

This change adds supports of wildcard in Products parameter of UpdateServicesServer resource.

For example:

        UpdateServicesServer 'UpdateServices'
        {
            DependsOn = @(
                '[WindowsFeature]UpdateServices'
            )
            Ensure = 'Present'
            ContentDir = 'C:\WSUS'
            Languages = @('en','fr')
            Products = @(
                'Windows Server*'
            )
            Classifications = @(
                'E6CF1350-C01B-414D-A61F-263D14D133B4', #CriticalUpdates
            )
            SynchronizeAutomatically = $true
            SynchronizeAutomaticallyTimeOfDay = '15:30:00'
            ClientTargetingMode = "Client"
        }

This PR cover the problem reported in issues #58 and #66 with ErrorRecord. line 703 of MSFT_UpdateServicesServer.psm1:

    New-InvalidResultException -Message $errorMessage

In Issue #67 and #61, we have the case of multiple products equals exact product title (like Windows Admin Center). This is fixed in line 623 fo MSFT_UpdateServicesServer.psm1:

                foreach ($pdt in $WsusProduct)

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable