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

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