标题。我似乎不能让这件事起作用,而且我对为什么感到恼火。Windows 2012R2数据中心下面的源代码直接来自安装CD的install.wim文件。它用以下错误出错:
The server could not update the provided feature files in the time allowed下面是代码,注意它显示了我正在尝试安装的特性。理论上,这不应该扩展到windows更新(我认为)。OTOH,我是一个开发人员,而不是一个windows管理员,所以我真的不知道潜在的行为应该是什么。这就是我来这里的原因,在这一点上,我已经尽我所能了。
这个错误是在什么情况下发生的,我该如何解决呢?
$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'
)
}发布于 2015-05-21 08:25:40
我还尝试使用在安装程序中安装几个特性。我结束时使用了,因为它似乎不太容易出错。您至少可以尝试一下,可能会得到更详细的错误消息。下面是脚本:
$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)。
发布于 2015-05-21 17:34:21
在Windows服务器2的非核心安装中,其中一个特性是net(我忘了它是另一个特性),这就是为什么您在wim中指向源代码的原因,就像MS状态一样,但这在大多数情况下都失败了。与其将源指向wimfile,您应该将其指向安装介质的\ source \sxs位置,这总是对我有好处的(您也可以指向带有文件的网络位置)
https://stackoverflow.com/questions/30360522
复制相似问题