Add-WindowsCapability 失败,并显示“找不到源文件”

Add-WindowsCapability 失败,并显示“找不到源文件”

我正在尝试在一些没有互联网连接的 Windows 10 系统上安装 RSAT。其中两个 Windows 10 系统是 20H2,其中一个是 21H2。这三个系统都有同样的问题。为了为离线系统安装 RSAT 工具,我找到了这个链接: https://michlstechblog.info/blog/windows-installing-rsat-tools-online-or-offline/

我使用此链接来确定在哪里/如何获取 FoD DVD ISO 文件: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/features-on-demand-v2--capabilities?view=windows-11 也许问题的一部分在于 FoD DVD 来自 Windows 10 2004 版本,但我在 my.visualstudio 下载部分找不到更新的版本。我手动检查了 Windows 10 的其他版本(搜索“按需功能”没有找到任何内容)。

当我执行“get-windowscapability”时,它似乎正确读取了源代码:

 C:\WINDOWS\system32> Get-WindowsCapability -Name "RSAT*" -Online -LimitAccess -Source "E:\" | Foreach-object {write-host $_.Name}
Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0
Rsat.CertificateServices.Tools~~~~0.0.1.0
Rsat.DHCP.Tools~~~~0.0.1.0
Rsat.Dns.Tools~~~~0.0.1.0
Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0
Rsat.FileServices.Tools~~~~0.0.1.0
Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0
Rsat.IPAM.Client.Tools~~~~0.0.1.0
Rsat.LLDP.Tools~~~~0.0.1.0
Rsat.NetworkController.Tools~~~~0.0.1.0
Rsat.NetworkLoadBalancing.Tools~~~~0.0.1.0
Rsat.RemoteAccess.Management.Tools~~~~0.0.1.0
Rsat.RemoteDesktop.Services.Tools~~~~0.0.1.0
Rsat.ServerManager.Tools~~~~0.0.1.0
Rsat.Shielded.VM.Tools~~~~0.0.1.0
Rsat.StorageMigrationService.Management.Tools~~~~0.0.1.0
Rsat.StorageReplica.Tools~~~~0.0.1.0
Rsat.SystemInsights.Management.Tools~~~~0.0.1.0
Rsat.VolumeActivation.Tools~~~~0.0.1.0
Rsat.WSUS.Tools~~~~0.0.1.0

但是当我尝试“add-windowscapability”时,它说找不到源文件:

C:\WINDOWS\system32> Get-WindowsCapability -Name "RSAT*" -Online -LimitAccess -Source "E:\" | Foreach-object {Add-WindowsCapability -Name $_.Name -Online -LimitAccess -Source "E:\" }
Add-WindowsCapability : The source files could not be found. 
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see 
https://go.microsoft.com/fwlink/?LinkId=243077.
At line:1 char:90
+ ... ach-object {Add-WindowsCapability -Name $_.Name -Online -LimitAccess  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-WindowsCapability], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand
 
Add-WindowsCapability : The source files could not be found. 
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see 
https://go.microsoft.com/fwlink/?LinkId=243077.
At line:1 char:90
+ ... ach-object {Add-WindowsCapability -Name $_.Name -Online -LimitAccess  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-WindowsCapability], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand

C:\WINDOWS\system32> Get-WindowsCapability -Name "RSAT*" -Online -LimitAccess -Source "E:\" | Add-WindowsCapability -Online -LimitAccess -Source "E:\"
Add-WindowsCapability : The source files could not be found. 
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see 
https://go.microsoft.com/fwlink/?LinkId=243077.
At line:1 char:74
+ ... urce "E:\" | Add-WindowsCapability -Online -LimitAccess -Source "E:\"
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-WindowsCapability], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand
   

我还检查了日志文件 (C:\Windows\Logs\DISM\dism.log),那里显示了相同的错误。有什么办法可以让它正常工作吗?提前谢谢。

相关内容