Since changing the licensing model for Universal Dashboard, it’s now possible to run a dashboard without buying license for development purposes. This means we can create short-lived dashboards to behave as developer tools. In this post we will cover and implementation of Out-GridView that will run in Windows PowerShell and PowerShell Core. It will work anywhere PowerShell Core works.
Just like Out-GridView, Out-UDGridView produces a grid with objects piped to it.
The implementation of Out-UDGridView is straight forward in terms of creating and presenting the dashboard. The complicated bit comes from dealing with the type formatting engine. If a formatting control exists for the type specified, then we need to find the correct headers from the table control and output the correct columns. This ensures the dashboard displays the same data as the table in the console.
Creating the grid and dashboard is the easy part. Out-UDGridView just populates the headers and properties of New-UDGrid and pipes the formatted data through Out-UDGridData.
We then find an unused port and then start the dashboard on that port. Finally, we pop open a web browser.
Out-GridView does a lot more processing than Out-UDGridView currently does. There are likely some scenarios that won’t work with Out-UDGridView. You can see some of that in the Microsoft PowerShell repository.
You can grab Out-UDGridView from GitHub. This has been developed using Universal Dashboard 1.5.3.