首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何通过Powershell启用Windows功能

如何通过Powershell启用Windows功能
EN

Stack Overflow用户
提问于 2013-01-09 21:33:36
回答 4查看 65.7K关注 0票数 28

我需要使用Powershell启用两个Windows功能。但我不知道他们的名字也不知道怎么找到他们。

到目前为止,我已经成功地安装了IIS,并使用一个找到here的脚本停止了默认应用程序池。

代码语言:javascript
复制
function InstallFeature($name) {
    cmd /c "ocsetup $name /passive"
}
InstallFeature IIS-WebServerRole
    InstallFeature IIS-WebServer
        InstallFeature IIS-CommonHttpFeatures
            InstallFeature IIS-DefaultDocument
            InstallFeature IIS-DirectoryBrowsing
            InstallFeature IIS-HttpErrors
            InstallFeature IIS-HttpRedirect
            InstallFeature IIS-StaticContent
        InstallFeature IIS-HealthAndDiagnostics
            InstallFeature IIS-CustomLogging
            InstallFeature IIS-HttpLogging
            InstallFeature IIS-HttpTracing
            InstallFeature IIS-LoggingLibraries
        InstallFeature IIS-Security
            InstallFeature IIS-RequestFiltering
            InstallFeature IIS-WindowsAuthentication
        InstallFeature IIS-ApplicationDevelopment
            InstallFeature IIS-NetFxExtensibility
            InstallFeature IIS-ISAPIExtensions
            InstallFeature IIS-ISAPIFilter
            InstallFeature IIS-ASPNET
    InstallFeature IIS-WebServerManagementTools 
        InstallFeature IIS-ManagementConsole 
        InstallFeature IIS-ManagementScriptingTools

import-module WebAdministration

Stop-WebAppPool DefaultAppPool

解决方案

要搜索:

代码语言:javascript
复制
Get-WindowsFeature *ASP*
Get-WindowsFeature *activation*

要安装:

代码语言:javascript
复制
Add-WindowsFeature NET-Framework-45-ASPNET
Add-WindowsFeature NET-HTTP-Activation
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14236406

复制
相关文章

相似问题

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