简体   繁体   English

PowerShell DSC,服务器 2019,.NET 3.5 无法从源安装

[英]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.我正在尝试使用 DSC 从源代码安装 .NET 3.5,因为我的服务器无法直接与 MSFT 联系。 But it is failing with error code 0x800f0954.但它失败了,错误代码为 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

Same thing here.这里也一样。 Seems to be that the DSC target is being redirected to WSUS.似乎是 DSC 目标被重定向到 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 HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
Property: UseWUServer属性:UseWUServer
Value: 0值:0

Or in DSC code:或在 DSC 代码中:

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.我还想设置重启标志并继续,但还没有弄清楚。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM