HTML Web page that Launches a powershell script

18,381

Solution 1

You have several frameworks/modules for this:

I used them all and the last one is probably the best for getting started and do what you want. Pipeworks is too complicated and ugly for me.

You should also consider Powershell Web Access instead of Web application .

Perhaps the best option would be to use scriptcs and execute posh scripts from within its script. See here for more details.

Solution 2

Try Presley? A Sinatra-like lightweight web framework written in PowerShell and can run PowerShell on server.

Share:
18,381
doobis
Author by

doobis

Updated on June 06, 2022

Comments

  • doobis
    doobis almost 2 years

    I am trying to find a way to host a website on a windows server in my environment. I would like to have a basic web page that can accept an entry value from the web page and then I would take that value and input it into my powershell script. My powershell script would do most the work but I have no idea how to collect data from the user and then make that data appear in my powershell script. The powershell script would run on the server side (not in front of the user) and then email them data that it collects. I would like to have a single webpage if possible. I tried to do that but also couldnt really figure that out.

    <!DOCTYPE html>
    <html>
    <head>
    <title> Self Service</title>
    </head>
    <body>
    
    <h1>Welcome to the Self Service</h1>
    <p>Below you can enter your userID .</p>
    
    <form action="ThankYou.html" method="post">
    UserID: <input type="text" name="text"><br>
    <input type="submit" value="Submit">
    </form>
    
    
    <input type="button" value="Launch Installer" onclick=
    
    </body>
    </html>