Search code examples
.netpowershelldscwindows-server-2019

PowerShell DSC, Server 2019, .NET 3.5 failing to install from source


I am trying to use DSC to install .NET 3.5 from source, as my server is not able to reach out directly to MSFT. But it is failing with error code 0x800f0954. Here is the code:

WindowsFeature NET_3_5 {
    Name = "Net-Framework-Features"
    Ensure = "Present"
    Source = "\\server_share_fqdn\share_name\S2019\sources\SxS"
}

WindowsFeature NET_3_5_Core {
    Name = "Net-Framework-Core"
    Ensure = "Present"
    Source = "\\server_share_fqdn\share_name\S2019\sources\SxS"
}

Where can I look to get more information on how to resolve this, or what's going wrong? If this makes a difference, when I run the following, it shows as "Removed" on a fresh install:

Get-WindowsFeature -Name Net-Framework-*

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[ ] .NET Framework 3.5 Features                         NET-Framework-Features         Available
    [ ] .NET Framework 3.5 (includes .NET 2.0 and 3.0)  NET-Framework-Core               Removed
[X] .NET Framework 4.7 Features                         NET-Framework-45-Fea...        Installed
    [X] .NET Framework 4.7                              NET-Framework-45-Core          Installed
    [X] ASP.NET 4.7                                     NET-Framework-45-ASPNET        Installed

Solution

  • Same thing here. Seems to be that the DSC target is being redirected to WSUS.

    This article describes the problem and fixes. Cutting to the chase, update the following reg key and reboot.

    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
    Property: UseWUServer
    Value: 0

    Or in DSC code:

    Import-DscResource -ModuleName PSDesiredStateConfiguration
    Registry Disable_WSUS {
      Ensure      = "Present"
      Key         = "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
    
      ValueName   = "UseWUServer"
      ValueData   = "0"
    }
    

    I'd also like to work on setting the reboot flag and continue, but have yet to figure that out.