header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left
May 23

Written by: Tobias
5/23/2008 8:46 PM

In this blog, I cover features in PowerShell Plus. Feature #7: Support for -STA and Windows Presentation Foundation

Check out the latest PS Team blog series covering WPF scripting in PS V2: http://blogs.msdn.com/powershell/archive/2008/05/22/wpf-powershell-part-1-hello-world-welcome-to-the-week-of-wpf.aspx

WPF scripting wasn't possible in PS V1 due to its threading mode. With PS V2, there is a new single-threaded mode, and you can use the -STA switch to activate this mode. Once activated, you can access and run WPF GUI scripts.

PowerShell Plus now also supports the -STA switch. However, I just added the feature so it is not yet available in the production version. Until it is released, you can download the latest beta here: http://www.powershell.com/downloads/psp1new.zip. It is V 1.0.4.4.

Unpack the ZIP, then create a new link to powershellplus.exe. Edit the link properties and add the -STA parameter. That is all. Tell me if this works for you...!

Enjoy!

Don't know PS+ yet? Go grab it: http://www.powershell.com/download/psp1.zip. Unzip, run. It's as easy as that. And it's free for non-commercial use. Enjoy!

Hungry for more? The latest (non-public) build is always available here: http://www.powershell.com/download/psp1new.zip. And the change log with the latest additions is available here: http://www.powershell.com/mantis/changelog_page.php.

Tags:

Re: -STA and WPF scripting

I actually went so far as to modify my ps+ shortcut in the start menu and have added the -sta flag to it permanently. So far I have not had anything not function as expected, so this is working well.

By halr9000 on   6/19/2008 3:07 AM
 

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Blogs
  
Search Blogs
  
Archives
  
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer