powershell - 启用 IIS 可选功能 IIS-ASPNET 和 IIS-ManagementConsole 时出错

标签 powershell iis server-core

我无法启用可选功能 IIS-ASPNET 和 IIS-ManagementConsole。我不断收到以下错误

Enable-WindowsOptionalFeature : One or several parent features are disabled so current feature can not be enabled.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand

需要启用 iis-aspnet 和 IIS-ManagementConsole 的父特性是什么?

最佳答案

您需要将-All 参数传递给Enable-WindowsOptionalFeatures安装所需的父功能:

Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET, IIS-ManagementConsole -All

关于powershell - 启用 IIS 可选功能 IIS-ASPNET 和 IIS-ManagementConsole 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59567483/

相关文章:

regex - PowerShell:在两个单词之间查找文本

http - 浏览文件时出现未经授权的错误

asp.net - w3wp.exe 对每个请求的 CPU 使用率都很高

asp.net - 无法序列化接口(interface) System.Collections.Generic.IDictionary

azure - Service Fabric 应用程序 vmImageSku

docker - SQL Server Express 无法在运行 docker 容器 (Windows) 时启动

.net - 如何从 Windows Server Core 上的 WPF 应用程序使用“浏览文件夹”对话框?

powershell - 将用户添加到本地组

c# - 使用 c# 程序的参数调用远程 powershell 脚本

powershell - 将Powershell代码导入.bat脚本