Calling powershell Script in an HTML Button OnClick function

is it possible to call or execute a Power shell script when i click on a Button in an HTML page?

I have Power shell scripts. I would like these scripts to execute when i click on a Button on a web page. Or executing script can only be done in Console?

July 25th, 2015 5:45pm

Hi,

You should be able to call al PS script via HTML onclick targetting C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command C:\Scripts\MyScript.ps1

But I'd suggest to use XAML to build a graphical interface to call your scripts, I started to build a powershell GUI (XAML & Powershell) that is a main menu to call my PS scripts located on a shared folder, I followed this great article : http://foxdeploy.com/2015/04/16/part-ii-deploying-powershell-guis-in-minutes-using-visual-studio/

I think it's more flexible & easier than HTML, and you can do much more things (menu / tabs etc...) using visual studio express to design the graphical interface. Just my point of view :)

Free Windows Admin Tool Kit Click here and download it now
July 26th, 2015 5:45pm

Hi,

You should be able to call al PS script via HTML onclick targetting C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command C:\Scripts\MyScript.ps1

But I'd suggest to use XAML to build a graphical interface to call your scripts, I started to build a powershell GUI (XAML & Powershell) that is a main menu to call my PS scripts located on a shared folder, I followed this great article : http://foxdeploy.com/2015/04/16/part-ii-deploying-powershell-guis-in-minutes-using-visual-studio/

I think it's more flexible & easier than HTML, and you can do much more things (menu / tabs etc...) using visual studio express to design the graphical interface. Just my point of view :)

July 26th, 2015 9:44pm

Hi,

You should be able to call al PS script via HTML onclick targetting C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command C:\Scripts\MyScript.ps1

But I'd suggest to use XAML to build a graphical interface to call your scripts, I started to build a powershell GUI (XAML & Powershell) that is a main menu to call my PS scripts located on a shared folder, I followed this great article : http://foxdeploy.com/2015/04/16/part-ii-deploying-powershell-guis-in-minutes-using-visual-studio/

I think it's more flexible & easier than HTML, and you can do much more things (menu / tabs etc...) using visual studio express to design the graphical interface. Just my point of view :)

Free Windows Admin Tool Kit Click here and download it now
July 26th, 2015 9:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics