Windows server2008 下 PowerShell对.NET3.5静默安装

Dim objShell,strCommonLine,strCommond1,strCommond2
Set objShell = CreateObject(WScript.Shell)
strCommonLine = "powershell.exe"
app = objShell.Run(strCommonLine)
objShell.AppActivate app

WScript.Sleep 100 
'对应角色功能列表命令
strCommond1 = "Import-Module ServerManager{ENTER}Add-WindowsFeature Application-Server,As-Web-Support,As-Ent-Services{ENTER}"
objShell.SendKeys strCommond1


WScript.Sleep 100
'退出操作
strCommond2 = "exit{ENTER}"
objShell.SendKeys strCommond2
WScript.quit

原文地址:https://www.cnblogs.com/zzhua/p/5705734.html