out-WPFGrid PowerShell CmdLet

July 9th, 2007

I’ve created a PowerShell CmdLet to show pipeline data in a WPF based Grid. WPFGridSnapIn.zip
To install:
1. Unzip the archive
2. Open a VS 2005 or VS Orcas Beta 1 command line (to get the right installutil version)
3. CD to the “WPFGridCommand\WPFGridCommand\bin\Debug” directory under wherever you unziped to.
4. InstallUtil WPFCommandCommand.dll
5. Start powershell
6. add-pssnapin WpfOutSnapIn
7. ps | out-wpfgrid

Step 7 should show you a grid of processes if it all works.

Implementing this was not straigtforward. I ended up using a separate process to host the WPF application and using WCF to communicate with it. Hosting WPF inside a PowerShell process ended up being a problem because there can only be one WPF Application object in a domain. I was able to work around that by initially reusing an existing Application, but any other WPF based CmdLet would be forced to use my Application derived object. Hosting out of process even though it’s slower, solved that issue and allows the grid to survive Powershell being shut down.

7 Responses to “out-WPFGrid PowerShell CmdLet”

  1. Doug Says:

    David

    Looking forward to trying it out.

    I don’t see the attached zip.

  2. Development in a Blink » Blog Archive » PoSHConsole - a more modern PowerShell Console Says:

    [...] A colleague, David Barnhill, posted a PowerShell Cmdlet Out-WPFGrid. It enables data to be piped to a WPF hosted Grid. [...]

  3. David Barnhill Says:

    I’ll get the code posted tonight. I posted this in a hurry and didn’t check the upload. Somehow wordpress lost my attachment when I edited a saved entry.

  4. David Barnhill Says:

    The link to the code and binaries works now.

  5. Latest Newsgroup Posts : out-WPFGrid cmdlet Says:

    [...] out-WPFGrid cmdlet FYI "I’ve created a PowerShell CmdLet to show pipeline data in a WPF based Grid." Source and all. [link] Published Wednesday, July 11, 2007 5:26 AM by microsoft.public.windows.powershell Google Group [...]

  6. halr9000 Says:

    Screenshots?

  7. Marco Shaw Says:

    I’m just not up to speed on programming in general. Would be cool to have this simply as “out-wpfdisplay” or similar. One could just pass it a simple text file with XAML in it, and have it display.

    Possible?