The Future Is Here Today

The Future Is Here Today

  • Comments 8

Would like to see what a PowerShell V2 world would look like?  If so, check out Jaykul Bennett's Select-Grid script HERE

Here is what impresses me so much about this:

  1. It is very useful to a broad range of users.
  2. It is simple to use and beautiful. 
  3. It leverages WPF.
  4. It is a well formed formal cmdlet.
  5. The code is pithy and self documenting.  200 lines of script.

Imagine hundreds, thousands, tens of thousands of other 200 line scripts with similar power. 
Imagine people taking this base script and adding 10 more lines to to things just they way they need them to be.  The might not have been able to write the script from scratch but it is not that hard to add 10 lines to an existing script.
Now imagine that have a graphics friend and you ask them to replace the WPF with something better looking from one of their professional XAML tools (e.g. Blend) and you get to use that XAML by just referring to it.

I predict that PowerShell V2 is going to produce a great virtuous cycle!

The one downside to the implementation is that it "leaks" it's utility functions.  In other words it has a number of helper functions like: Get-Max, Get-DefaultValue, Get-PropertyTypes, etc.  When you dot-source the file, these helper functions are visible as well which means that they'll collide with others if you dot source something else that uses those names.  This is exactly the problem that MODULES are designed to solve. So I hope the next version is released as a module.

 Wonderful stuff Jaykul!

Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Comment
  • Please add 6 and 8 and type the answer here:
  • Post
  • Hi, I am glad to meet PowerShell's interactive -sta option, but there is one trouble.

    I want to draw WPF window  and  interactively change it on PowerShell.

    How is it possible?

  • I like this promising script and the idea itself. I have a warning though:

    The script invokes Set-PSDebug -Strict. It is nice for development, indeed, but it should be avoided in production scripts (or, say, published scripts) because this command changes session state globally and quite seriously – some other commands or scripts may fail after using this (even after dot-sourcing only) with typical error message “The variable ... cannot be retrieved because it has not been set yet.”

  • In this second part in this series ( the 5th about WPF ) a bit more about creating the interfacing part,

  • Thanks for the link :) do you realize that you repeatedly said "image" when you meant "imagine"?

    I did release it as a module now -- I wrote it with those functions at the bottom (instead of inside the BEGIN{} block) because I intended to, but I couldn't figure out what I had to do to get modules to load: there's basically no information about them out here except a single example in the readme.  I got some help now from one of the MVPs who had a little more info than what's publicly available.

    Oh, and, I'm ...

    --

    Joel "Jaykul" Bennett  ;)

  • oh, and by the way, about Smith Cater's question ... did you see the previous article? http://huddledmasses.org/wpf-from-powershell-updating-windows/

  • > do you realize that you repeatedly said "image" when you meant "imagine"?

    Yes - I intentionally put in bad grammar and spelling mistakes to let everyone know that I'm really an engineer.  :-)

    Thanks for pointing that out - I fixed it.

    jps

  • Thanks Jaykul, and I'm sorry to be poor at English...

    What I want to do is like the following.

    #

    $a = New-Object system.windows.window

    $a.Left = 0

    $a.ShowDialog() #If I use Show() I get next prompt, but WPF window doesn't work well.

    $a.Left = 100 #In fact, prompt dosen't return, so I can't Enter this.

    $a.Left = 200

    ...

    #

  • My latest links about WPF (Apps, Controls, 3.5sp1 beta, HowTo, for LOB), Silverlight, XAML and URLs WPF

Page 1 of 1 (8 items)