I’ve been reading about the new HttpPlatformHandler that the Azure team has released and is using to host Java and Ruby inside of IIS.
For some context see, Announcement, http://azure.microsoft.com/blog/2015/02/04/announcing-the-release-of-the-httpplatformhandler-module-for-iis-8/
and Scott Hanselman testing, http://www.hanselman.com/blog/AnnouncingRunningRubyOnRailsOnIIS8OrAnythingElseReallyWithTheNewHttpPlatformHandler.aspx
I was curious to see if it was possible to host PowerShell and PowerShell.exe in a similar fashion to the Java and Ruby setups detailed above. I think I’m missing a few things, or maybe I’ve just missed the boat completely. Either is fine. I was curious and was wondering if anyone else has investigated HttpPlatformHandler and its potential for PowerShell.
What I was trying to investigate and hopefully take advantage of was the IIS process management. Much like ASP.net apps in IIS if an app goes bad or crashes IIS restarts the process. I was looking to get this functionality for PowerShell scripts that use and consume events. Events are great, but only useful as long as the process is running. Close ISE or the PowerShell host and no more event actions. The script and web.config that I have been testing with are below. I’m not trying to solve a production problem, and I’m aware of the many other ways to deal with events. I’m investigating a new thing and if you have any thoughts please let me know what you think?
The web.config and the ps1 file are attached.