PowerShell ASP – Too cool!

For the longest time, people have been asking me when they’ll be able to use PowerShell in ASP.  It makes perfect sense – PowerShell is a great language that let’s you do amazing things quickly.  Sadly, my answer has always been:



At Microsoft, to ship is to choose.


We are trying to solve the problem of administrating and automating Windows and until we get things like Remoting, Jobs, Eventing, etc done, it would be a breach of our responsibilities to pursue ASP programming no matter how cool and useful it would be.  Now let me be clear, I believe ASP programming is SUPER useful to Admins (as well as everyone else).  It is just that we need to do first things first.


So now to the great news:  The superstars at NSoftware have finally solved this problem and published PowerShellASP.  Here is their description of it:



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.


 Are you drooling yet?  If not, check out this example:


<html>
  <body>
    <table>
      <tr><td>ID</td></tr>
      <% get-process | foreach { %> 
        <tr>
          <td><%=$_.ID%></td>
          <td><%=$_.ProcessName%></td>
        </tr>
      <% } %>
    </table>
  </body>
</html>


Is that awesome or what? 
Still not drooling?  Check this out:  it’s FREE!
I told you they were superstars!
Download it and blog about your experiences – I’d love to hear what you think.


BTW:  NSoftware is also ships NetCmdlets, a rich collection of cmdlets to deal a wide range of protocols including SSH and SNMP.  Did you know that you can do remote PowerShell over SSH today?  With NetCmdlets you can.  Check those out HERE.


Enjoy!


Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx