out-WPFGrid PowerShell CmdLet
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.



July 9th, 2007 at 8:41 pm
David
Looking forward to trying it out.
I don’t see the attached zip.
July 9th, 2007 at 8:52 pm
[...] A colleague, David Barnhill, posted a PowerShell Cmdlet Out-WPFGrid. It enables data to be piped to a WPF hosted Grid. [...]
July 10th, 2007 at 7:59 am
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.
July 11th, 2007 at 6:19 am
The link to the code and binaries works now.
July 11th, 2007 at 9:03 am
[...] 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 [...]
July 11th, 2007 at 3:54 pm
Screenshots?
September 7th, 2007 at 2:56 pm
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?