Making a powershell script run from aspx – it worked in 1/2 hour!

So, there is this process, that if the user could click a button themselves would save a lot of stress on everyone – the person who has to run the powershell script AND the people who have to ask (who wants to pester someone all the time?)

So in prep – I did a test – I didn’t know anything about powershell scripting so I hit google. I found a simple copy/paste of a file script and modified it to copy a file from one directory to another (and it echos something to the command line). Since it is the www – I made a share location so that it could be run from the network instead of my “C:\temp” directory because C: means MY c:\ and MY will change depending on who hits the button.

Next, I went and copied and pasted an example from someone else, found out which “using” statements are required, hooked up a following DLL manually required to get this working and presto – it worked in about 1/2 hour. Here are the steps: Continue reading