Is there a way to get user input to Powershell's Read-Host from PHP?

160 views Asked by At

I have a Powershell script which I'm trying to implement on a website with PHP's shell_exec.

The script will usually complete on it's own without the need for user input. However in some rare cases, user input is needed. Read-Host is good when running the .ps1-file on its own, but with shell_exec the script will simply stop executing if it reaches Read-Host.

Is there a way to make a connection here and prompt for user input through HTML/PHP? Or do I have to rewrite?

I have googled for a while but didn't get any smarter.

0

There are 0 answers