首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我搞不懂为什么安装-WindowsFeature超时了

我搞不懂为什么安装-WindowsFeature超时了
EN

Stack Overflow用户
提问于 2015-05-20 21:16:54
回答 2查看 3.2K关注 0票数 1

标题。我似乎不能让这件事起作用,而且我对为什么感到恼火。Windows 2012R2数据中心下面的源代码直接来自安装CD的install.wim文件。它用以下错误出错:

代码语言:javascript
复制
The server could not update the provided feature files in the time allowed

下面是代码,注意它显示了我正在尝试安装的特性。理论上,这不应该扩展到windows更新(我认为)。OTOH,我是一个开发人员,而不是一个windows管理员,所以我真的不知道潜在的行为应该是什么。这就是我来这里的原因,在这一点上,我已经尽我所能了。

这个错误是在什么情况下发生的,我该如何解决呢?

代码语言:javascript
复制
$features = Get-Features
$source = "wim:C:\WindowsCore\install.wim:4"

Install-WindowsFeature -Name $features -IncludeManagementTools -Source $source -WarningAction SilentlyContinue | Out-Null

function Get-Features {
  return [string[]] @(
      'FileAndStorage-Services'
      'Storage-Services'
      'Web-Server'
      'Web-WebServer'
      'Web-Common-Http'
      'Web-Default-Doc'
      'Web-Dir-Browsing'
      'Web-Http-Errors'
      'Web-Static-Content'
      'Web-Http-Redirect'
      'Web-Health'
      'Web-Http-Logging'
      'Web-Log-Libraries'
      'Web-ODBC-Logging'
      'Web-Request-Monitor'
      'Web-Http-Tracing'
      'Web-Performance'
      'Web-Stat-Compression'
      'Web-Dyn-Compression'
      'Web-Security'
      'Web-Filtering'
      'Web-Basic-Auth'
      'Web-Client-Auth'
      'Web-Digest-Auth'
      'Web-Cert-Auth'
      'Web-IP-Security'
      'Web-Url-Auth'
      'Web-Windows-Auth'
      'Web-App-Dev'
      'Web-Net-Ext'
      'Web-Net-Ext45'
      'Web-ASP'
      'Web-Asp-Net'
      'Web-Asp-Net45'
      'Web-CGI'
      'Web-ISAPI-Ext'
      'Web-ISAPI-Filter'
      'Web-Includes'
      'Web-WebSockets'
      'Web-Ftp-Server'
      'Web-Ftp-Service'
      'Web-Mgmt-Tools'
      'Web-Mgmt-Console'
      'Web-Mgmt-Compat'
      'Web-Metabase'
      'Web-Lgcy-Mgmt-Console'
      'Web-Lgcy-Scripting'
      'Web-WMI'
      'Web-Scripting-Tools'
      'Web-Mgmt-Service'
      'NET-Framework-Features'
      'NET-Framework-Core'
      'NET-Framework-45-Features'
      'NET-Framework-45-Core'
      'NET-Framework-45-ASPNET'
      'NET-WCF-Services45'
      'NET-WCF-HTTP-Activation45'
      'NET-WCF-TCP-PortSharing45'
      'RSAT'
      'RSAT-Feature-Tools'
      'RSAT-SMTP'
      'RSAT-SNMP'
      'FS-SMB1'
      'SMTP-Server'
      'SNMP-Service'
      'User-Interfaces-Infra'
      'Server-Gui-Mgmt-Infra'
      'Server-Gui-Shell'
      'PowerShellRoot'
      'PowerShell'
      'PowerShell-V2'
      'PowerShell-ISE'
      'WAS'
      'WAS-Process-Model'
      'WAS-Config-APIs'
      'WoW64-Support'
    )
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-05-21 08:25:40

我还尝试使用在安装程序中安装几个特性。我结束时使用了,因为它似乎不太容易出错。您至少可以尝试一下,可能会得到更详细的错误消息。下面是脚本:

代码语言:javascript
复制
$featuresToInstall = ('FileAndStorage-Services','Storage-Services','Web-Server','Web-WebServer','Web-Common-Http','Web-Default-Doc','Web-Dir-Browsing','Web-Http-Errors',
'Web-Static-Content','Web-Http-Redirect','Web-Health','Web-Http-Logging','Web-Log-Libraries','Web-ODBC-Logging','Web-Request-Monitor',
'Web-Http-Tracing','Web-Performance','Web-Stat-Compression','Web-Dyn-Compression','Web-Security','Web-Filtering','Web-Basic-Auth',
'Web-Client-Auth','Web-Digest-Auth','Web-Cert-Auth','Web-IP-Security','Web-Url-Auth','Web-Windows-Auth','Web-App-Dev','Web-Net-Ext',
'Web-Net-Ext45','Web-ASP','Web-Asp-Net','Web-Asp-Net45','Web-CGI','Web-ISAPI-Ext','Web-ISAPI-Filter','Web-Includes','Web-WebSockets',
'Web-Ftp-Server','Web-Ftp-Service','Web-Mgmt-Tools','Web-Mgmt-Console','Web-Mgmt-Compat','Web-Metabase','Web-Lgcy-Mgmt-Console','Web-Lgcy-Scripting',
'Web-WMI','Web-Scripting-Tools','Web-Mgmt-Service','NET-Framework-Features','NET-Framework-Core','NET-Framework-45-Features','NET-Framework-45-Core',
'NET-Framework-45-ASPNET','NET-WCF-Services45','NET-WCF-HTTP-Activation45','NET-WCF-TCP-PortSharing45','RSAT','RSAT-Feature-Tools','RSAT-SMTP',
'RSAT-SNMP','FS-SMB1','SMTP-Server','SNMP-Service','User-Interfaces-Infra','Server-Gui-Mgmt-Infra','Server-Gui-Shell','PowerShellRoot','PowerShell',
'PowerShell-V2','PowerShell-ISE','WAS','WAS-Process-Model','WAS-Config-APIs','WoW64-Support')

# Remove any feature that is not available to prevent dism failures. MSMQ-Container for example is only available 
# on Windows 7 but not on Windows Server 2008 R2. 
$availableFeatures = dism /online /Get-Features
$featuresToRemove = @()
$featuresToInstall | % { if (-not ($availableFeatures | Select-String ('{0}$' -f $_) -Quiet)) { $featuresToRemove += $_} }
$featuresToInstall = Compare-Object -ReferenceObject $featuresToInstall -DifferenceObject $featuresToRemove | select -ExpandProperty InputObject

$dismParameter = @('/online', '/Enable-Feature', ($featuresToInstall | % { '/FeatureName:{0}' -f $_ }), '/NoRestart', '/all')

$output = dism @dismParameter

# throw an error if dism wasn't successful
if ($global:LastExitCode -ne 0)
{
    throw 'Error while installing Windows Features. {0}' -f ($output | Select-String '\.log$')
}

脚本还验证功能是否可用,并在这种情况下删除它们(您可以检查$featuresToRemove)。

票数 0
EN

Stack Overflow用户

发布于 2015-05-21 17:34:21

在Windows服务器2的非核心安装中,其中一个特性是net(我忘了它是另一个特性),这就是为什么您在wim中指向源代码的原因,就像MS状态一样,但这在大多数情况下都失败了。与其将源指向wimfile,您应该将其指向安装介质的\ source \sxs位置,这总是对我有好处的(您也可以指向带有文件的网络位置)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30360522

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档