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