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.