PowerShellASP
I can’t tell you how excited I am about PowerShellASP, but I will… While making the transition from VBScript to PowerShell there were two pieces of functionality that I could not live without; HTML Applications (HTA) and Dynamic .ASP web pages. This functionality allows me to distribute VBScripts wrapped in an application or as a web page. I’m able to (and still do) write code that is utilized by clients who have no scripting or programming background, like my mom!
Let me show you an example of what an HTA is so that you get a better picture..
HTML Applications
This is my Server Maintenance HTML Application Tool:
HTA
And here is a snippet of the code behind the scenes, notice that the VBScript code is wrapped in HTML:
HTA VBScript Code
Basically an HTA is Internet Explorer with all the tool bars stripped out, looks just like a windows form application (okay close…).
What a great way to distribute your VBScript as a simple application. Distributing PowerShell scripts in the same fashion requires a .NET class called the Forms Class (Systems.Windows.Forms). We are starting to see Form editors for PowerShell emerge on the market, the most well know being the AdminScriptEditor(ASE). But what about using PowerShell for dynamic web pages?
ASP
Dynamic web pages require some type of programming language to make them… well, dynamic! The language I use as an administrator is VBScript. Here is a simple web page that allows you to enter a computer name to check that the Anti-virus engine and dats are up-to-date.
I know, not much to look at but it’s functional. The point is… I don’t have to distribute HTAs or PowerShell Windows Forms all over the place, I can centralize my tools on a website. Administrators in the organization can utilize this page and check their systems. So needles to say I was a bit disapointed that PowerShell was not supported in .ASP. Now that has finally changed and it was not Microsoft who came up with the answer…
PowerShellASP
From their site:
PowerShellASP is an ASP-like template language for Web Applications; templates contain a mixture of markup (HTML, XML or whatever you want to generate) and inline PowerShell code. At runtime, templates/pages are fully translated to PowerShell code and executed as a single unit inside a PowerShell pipeline, with the results sent to the client browser.
PowerShellASP runs off the ASP.NET platform, implemented as a custom IHttpHandler mapped to *.ps1x files. Because of this, you can mix PowerShellASP pages alongside any ASP.NET application. This provides a great way to leverage PowerShellASP inside your existing applications as needed or you can create complete applications from scratch based only on *.ps1x pages.
For anyone interested in PowerShellASP it is a Free download.
Email This Post To A Friend
« How to Send Alerts to Your Mailbox using .NET | Home | PowerShell Big Hit at VMworld 2008 »






Leave a Comment