A PowerShell Powered ASP.NET Panel Control
A PowerShell Powered ASP.NET Panel Control
  • Easy-to-use ASP.NET Panel Web control for integrating PowerShell content into ASP.NET pages and applications.
  • Use a mix of HTML and inline PowerShell script to rapidly create dynamic content regions.
Download Free Trial

PowerShell Panel can be used to render PowerShell ASP templates from within any ASP.NET Web Page. PowerShell ASP is an ASP-like template language that contains a mixture of markup (HTML, XML or whatever you want to generate) and inline PowerShell code.

Using The PowerShell ASP.NET Panel

To use the PowerShell Panel all you need to do is follow these simple steps:

  1. Create a new ASP.NET Web Site/Application or open an existing one in Visual Studio.
  2. Add a reference to the nsoftware.PowerShellPanel.dll assembly, or copy it to your website's ./bin folder
  3. In the ASP.NET page or control you want to use PowerShell Panel, register the control:
    <%@ Register Assembly="nsoftware.PowerShellPanel"
    	Namespace="nsoftware.PowerShellPanel"
    	TagPrefix="cc1" %>
  4. Add the PowerShell Panel control and simply write your PowerShell ASP script directly into the panel:
    <cc1:PowerShellPanel ID="PSPanel2" runat="server">
    <asp:Label ID='Label2' ForeColor="Red" runat="server" Text="<%= $request.PhysicalApplicationPath %>" />
    <ol>
    	<% ls 'c:\' | %{ %>
    		<li><%= $_.Name %></li>
    	<% } %>
    </ol>
    </cc1:PowerShellPanel>

Intrinsic Objects

In addition to running standard PowerShell code, you may want to interact with the HTTP runtime through the use of the ASP.NET intrinsic objects like HttpRequest and HttpResponse. Refer to the product overview for more information about referencing ASP.NET intrinsic objects.