业务背景
安装部署服务器时,需要完整安装IIS、NetFramework,基于运维考虑,一般会建议安装Telnet。
IIS角色完整安装有约43项、NetFramework约10来项,每次在服务器管理器一项项勾选,都要成斗鸡眼了。
解决方案
在服务器上,使用管理员身份运行PowerShell,执行如下命令,解放你的双眼。
1、安装IIS
Get-WindowsFeature -Name "Web-*" | ? Name -Notmatch "Ftp|Lgcy|Proxy" | Install-WindowsFeature
2、安装NetFramework
Get-WindowsFeature -Name "NET-*" | Install-WindowsFeature
3、安装Telnet
Get-WindowsFeature -Name "Telnet-*" | Install-WindowsFeature
4、整合安装(一刀流)
Get-WindowsFeature -Name "Web-*", "NET-*", "Telnet-*" | ? Name -Notmatch "Ftp|Lgcy|Proxy" | Install-WindowsFeature
如果要指定本地源,可增加-Source参数及值。
Get-WindowsFeature -Name "Web-*", "NET-*", "Telnet-*" | ? Name -Notmatch "Ftp|Lgcy|Proxy" | Install-WindowsFeature -Source "D:\sources\sxs"
作者:无涯有涯
原文链接:https://vip.kingdee.com/article/498442779635086592?productLineId=1&lang=zh-CN

Blog.XiaoMing.Xyz




