Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Re: STAThread in PowerShell 2

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 05-07-2008   #1 (permalink)
Marco Shaw [MVP]
Guest


 

Re: STAThread in PowerShell 2

Lionel Fourquaux wrote:
Quote:

> I remember reading that PowerShell 2 will include a way to use objects
> that require STA threads, but I did not find how to do it in the CTPs.
> What is the syntax for CTP2? (unless it is not yet included?)
v2 CTP1 apparently did not include it (unless you used invoke-apartment
available from the PowerShell team blog).

v2 CTP2 provides the ability built-in:
1. For powershell.exe, just start it with the flag -sta. See
"powershell /?" output. By default, powershell.exe runs in MTA mode.

2. For graphical powershell, the interface runs in an STA thread.

See also some recent posts by "Jaykul":
http://huddledmasses.org/

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing PowerShell dependent features on W2K8 with PowerShell CTP Greg Wojan PowerShell 14 05-16-2008 08:15 AM
when run powershell script as windows service ,powershell fail powershell fail on winodws 2008 PowerShell 6 01-15-2008 03:20 PM
Powershell Plus - Free for non commercial Use and Powershell Analyzer1.0 released Karl Prosser[MVP] PowerShell 2 12-12-2007 12:43 PM
Automatic PowerShell Error Parsing in PowerShell Analyzer and PowerShellPlus Karl Prosser[MVP] PowerShell 0 11-14-2007 02:32 AM
PowerShell Leaders Join Forces and offer a pre-release version of PowerShell for 50% off the retail value klumsy@xtra.co.nz PowerShell 0 06-19-2007 02:42 PM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008