3 More Ways To Inject Dynamic WPF GUIs into your PowerShell Pipeline

by Doug Finke on August 17, 2009

in .Net,C#,C# 3.0,PowerBoots,PowerShell,WPF

Inject Dynamic WPF GUIs into your PowerShell Pipeline shows Edit-Object. You supply an imageobject and it creates a WPF GUI so you can edit it. The example compiles C# code on the fly.

Below are three native PowerShell objects being edited in the pipeline. A PowerShell Custom Object, Get-Process Object and Get-ChildItem object.

There are plenty of others to experiment with too.

 

 

 

PowerShell  Custom Object

Produces the same screen as above using a PSObject.

$obj = New-Object PSObject |
        Add-Member -PassThru NoteProperty Name 'John Doe'                |
        Add-Member -PassThru NoteProperty Age 5                          |
        Add-Member -PassThru NoteProperty Address 'SomeWhere in the USA' |
        Add-Member -PassThru NoteProperty City 'Common Town'             |
        Add-Member -PassThru NoteProperty State 'State'                  |
        Add-Member -PassThru NoteProperty Zip '00000'            

Edit-Object $obj
            

 

Built-in  Get-Process

Edit-Object  (Get-Process svc* | select -First 1 Name, Company)            

image

 

 

 

 

 

Get-ChildItem

Edit-Object (Get-ChildItem | select -First 1)            

image

Grab the Code

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>