I need to run PowerShell command lines in Classic ASP and return the search result.
I found a code, but it's not working
<%
Set objShell = server.CreateObject("WScript.Shell")
Set objExec = objShell.Exec("powershell.exe -Command dir")
Set objStdOut = objExec.StdOut
While Not objStdOut.AtEndOfStream
Response.write objStdOut.ReadLine
Wend
objExec.StdIn.Close()
%>
Does not generate error and page returns blank.
Can someone help me?