Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UpdateServicesServer] Products test return false after set #47

Open
phoenix2pm opened this issue Dec 19, 2019 · 0 comments
Open

[UpdateServicesServer] Products test return false after set #47

phoenix2pm opened this issue Dec 19, 2019 · 0 comments
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@phoenix2pm
Copy link

phoenix2pm commented Dec 19, 2019

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

Some Wsus products have non ASCII characters in their Title. In particular "Windows Server Manager – Windows Server Update Services (WSUS) Dynamic Installer" dash (" - ") is not in ASCII format therefore comparison is failing subsequently test and set is failing.

Verbose logs showing the problem

Suggested solution to the issue

Suggested solution to strip all none alphanumerical characters using this method: ToCharArray().Where{ $_ -imatch "[a-z0-9]" } -join '' i.e. like this:

foreach ($Product in $Products) {
                   # Due to none ASCII characters used in Product titles in particular "Windows Server Manager – Windows Server Update Services (WSUS) Dynamic Installer" dash (" - ") is not in ASCII format
                   # had to strip all none alphanumerical characters to compare the titles. to do so used this method: ToCharArray().Where{ $_ -imatch "[a-z0-9]" } -join '' 
                   if ($WsusProduct = $AllWsusProducts | Where-Object { ($_.Title.ToCharArray().Where{ $_ -imatch "[a-z0-9]" } -join '') -eq ($Product.ToCharArray().Where{ $_ -imatch "[a-z0-9]" } -join '') }) {
                       Write-Verbose "Setting WSUS Product: $($Product)"
                       $null = $ProductCollection.Add($WsusServer.GetUpdateCategory($WsusProduct.Id))
                   }
               }

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

products                          = @(
            'ASP.NET Web and Data Frameworks'
            'ASP.NET Web Frameworks'
            'Azure File Sync agent updates for Windows Server 2016'
            'Windows Server 2016 and Later Servicing Drivers'
            'Windows Server 2016'
            'Windows Server Manager - Windows Server Update Services (WSUS) Dynamic Installer'
        )

The operating system the target node is running

Version and build of PowerShell the target node is running

Version of the DSC module that was used ('dev' if using current dev branch)

master branch
version: 1.1.0.0

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants