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, UpdateServicesApprovalRule: Allow use of friendly names or GUIDs in Products, Classifications #65

Open
MartinVokurek opened this issue Feb 16, 2021 · 2 comments

Comments

@MartinVokurek
Copy link

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

This is for both the UpdateServicesServer and UpdateServicesApprovalRule resources:
The Products property currently accepts friendly names while Classifications accepts GUIDs. GUIDs are not overly easy to work with. Given that there's already code to translate Titles to GUIDs for Products, the same approach could be used for Classifications as well.

I am aware that this has already been discussed in #18

Verbose logs showing the problem

Suggested solution to the issue

To avoid language dependency, as well as to avoid the introduction of breaking change, the properties could be made to accept both friendly names as well as GUIDs. The desired values could be compared against Title or ID.

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

# This works OK
Configuration WSUSProduct {
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Import-DscResource -ModuleName 'UpdateServicesDsc' -ModuleVersion 1.2.1
    
    Node localhost {
 
        UpdateServicesServer WSUS {
            Ensure = 'Present'
            Languages = 'en'

            # Classification must be a GUID
            Classifications = '0fa1201d-4330-4fa8-8ae9-b877473b6441' # Security Updates

            # Products use Title
            Products = 'Windows Server 2016'
        }
    }
}

# This does not work
Configuration WSUSProduct {
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Import-DscResource -ModuleName 'UpdateServicesDsc' -ModuleVersion 1.2.1
    
    Node localhost {
 
        UpdateServicesServer WSUS {
            Ensure = 'Present'
            Languages = 'en'

            # Title can't be used in Classifications
            Classifications = 'Security Updates'

            # GUIDs can't be used in Products 
            Products = '569e8e8f-c6cd-42c8-92a3-efbb20a0f6f5' # Windows Server 2016
        }
    }
}

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

Name              Version Path                                                                                       
----              ------- ----                                                                                       
UpdateServicesDsc 1.2.1   C:\Program Files\WindowsPowerShell\Modules\UpdateServicesDsc\1.2.1\UpdateServicesDsc.psd1
@IrishTR
Copy link

IrishTR commented Apr 8, 2022

Has anyone figured out how to resolve this? I can't include any Server 2019 in my DSC configs because of this problem it is rather annoying.

@mbailey-eh
Copy link

Having this issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants