ASP.NET PowerShell Data Source Control

Extending on the small proof-of-concept I mentioned yesterday I created this simple data source control that lets you bind a Repeater or DataGrid to it like an ObjectDataSource control but it executes a PowerShell script to retrieve the results.

<asp:PowerShellDataSource ID="EmployeesDataSource" runat="server">
    [PSObject]"" | Add-Member NoteProperty "Title" "Software Engineer" -passThru | Add-Member NoteProperty "Name" "Mike Wolford" -passThru
    [PSObject]"" | Add-Member NoteProperty "Title" "Software Evangelist" -passThru | Add-Member NoteProperty "Name" "Scott Root" -passThru
</asp:PowerShellDataSource>



<asp:Repeater runat="server" DataSourceID="EmployeesDataSource">
    <ItemTemplate>
        <h4><%# DataBinder.Eval(Container.DataItem, "Title") %>: <%# DataBinder.Eval(Container.DataItem, "Name") %></h4>
    </ItemTemplate>
</asp:Repeater>

If this is something that interests you, take a look over  at http://aspower.codeplex.com/

No Comments