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

UpdateServicesApprovalRule: Broken verbose output #63

Open
MartinVokurek opened this issue Feb 12, 2021 · 0 comments · May be fixed by #64
Open

UpdateServicesApprovalRule: Broken verbose output #63

MartinVokurek opened this issue Feb 12, 2021 · 0 comments · May be fixed by #64

Comments

@MartinVokurek
Copy link

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

Verbose output of Get-TargetResource returns Microsoft.UpdateServices.Internal.BaseApi.UpdateServer instead of WSUS server name

Verbose logs showing the problem

VERBOSE: [SRV1]: LCM:  [ Start  Resource ]  [[UpdateServicesApprovalRule]Approval]
VERBOSE: [SRV1]: LCM:  [ Start  Test     ]  [[UpdateServicesApprovalRule]Approval]
VERBOSE: [SRV1]:                            [[UpdateServicesApprovalRule]Approval] Identified WSUS server information: Microsoft.UpdateServices.Internal.BaseApi.UpdateServer
VERBOSE: [SRV1]: LCM:  [ End    Test     ]  [[UpdateServicesApprovalRule]Approval]  in 0.0470 seconds.
VERBOSE: [SRV1]: LCM:  [ Skip   Set      ]  [[UpdateServicesApprovalRule]Approval]
VERBOSE: [SRV1]: LCM:  [ End    Resource ]  [[UpdateServicesApprovalRule]Approval]

Suggested solution to the issue

Write-Verbose -Message ('Identified WSUS server information: {0}' -f $WsusServer)

Change the line to:

Write-Verbose -Message ('Identified WSUS server information: {0}' -f $WsusServer.Name)

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

Configuration WSUSProduct {
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Import-DscResource -ModuleName 'UpdateServicesDsc' -ModuleVersion 1.2.1
    
    Node localhost {

        UpdateServicesApprovalRule Approval {
            Ensure = 'Present'
            Name = 'Test Approval Rule'
            Classifications = @(
                # Updates
                'cd5ffd1e-e932-4e3a-bf74-18bf0b1bbd83'
            )
            Products = 'Windows Server 2016'
            ComputerGroups = 'All Computers'
            Enabled = $true
        }
    }
}

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
MartinVokurek pushed a commit to MartinVokurek/UpdateServicesDsc that referenced this issue Feb 12, 2021
NicolasBn added a commit to NicolasBn/UpdateServicesDsc that referenced this issue Sep 4, 2022
gaelcolas pushed a commit that referenced this issue Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant