WinServer2008下通过powershell获取IIS等角色功能列表,保存至txt

Set objShell = CreateObject("WScript.Shell")

strCommondLine = "powershell.exe"

app = objShell.Run(strCommondLine)

objShell.AppActivate app

WScript.Sleep 100

strCommond = "Import-Module ServerManager {ENTER} Get-WindowsFeature|out-file IISServiceList.txt -Encoding UTF8 {ENTER} Exit {ENTER}"

objShell.SendKeys strCommond

WScript.quit

posted @ 2016-07-20 23:21  Zohar  阅读(267)  评论(0编辑  收藏  举报