Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: I thought Powershell was MTA (V2 of PS and V2 of this post) in microsoft.public.windows.powershell

Started 1 month, 1 week ago by CodeSlinger
Sorry if this doubles posts but the Windows Vista x64 forum is not working properly so am posting here directly. I have an application that hosts Powershell and supplies the PSHost. PSHostUserInterface and PSHostRawUserInterface interfaces and my write routines are all reentrant and my app is MTA. When I run the below script,...
Site: Discussions in microsoft.public.windows.powershell  Discussions in microsoft.public.windows.powershell - site profile
Forum: microsoft.public.windows.powershell  microsoft.public.windows.powershell - forum profile
Total authors: 4 authors
Total thread posts: 7 posts
Thread activity: no new posts during last week
Domain info for: microsoft.com

Other posts in this thread:

Martin Zugec replied 1 month, 1 week ago
Hi Dave, AFAIK (haven't played with it yet), Posh is STA only, to support MTA, you will need to use jobs for that (Posh v2 only) Easiest way to confirm that is to play with FileSystemWatcher. Martin "CodeSlinger" <CodeSlinger@discussions.microsoft.com> wrote in message news:64BD25C6-467F-4544-B657-F51FC7ED2D93@microso ft.com...

CodeSlinger replied 1 month, 1 week ago
OK I figured it out. Instead of hard waiting on a ManualResetEvent which locks up the script main thread, I have my application create a plain old ordinary event, put that in a session variable when I create the Runspace and then have my script do Register-ObjectEvent for THAT event and a wait-event for that event. Works ...

Marco Shaw [MVP] replied 1 month, 1 week ago
By default with version 2, powershell.exe runs in STA mode, you can very easily start it in MTA by passing the flag "-mta" to powershell.exe when starting it. powershell_ise.exe runs exclusively in MTA though. Marco "Martin Zugec" <martin.zugec@gmail.com> wrote in message news:8E02466D-E3D9-4342-8A72-5B74EB9BB6E8@...

CodeSlinger replied 1 month, 1 week ago
That's really weird. V1 apparently did the opposite on both accounts from what I've read and I had not read that before about V2 running a different apartment model. I'll have to test and make sure I'm still working in MTA mode since I require V2 but should be OK since I design for MTA in the first place. I had not actually dumped the ...

CodeSlinger replied 1 month, 1 week ago
Actually to be clear, you can't put the actual event in the session. I know, I tried. I actually put an object and the event is a public member. - Dave "CodeSlinger" wrote: > OK I figured it out. > > Instead of hard waiting on a ManualResetEvent which locks up the script main > thread, I have my application create a...

Oisin (x0n) Grehan [MVP] replied 1 month, 1 week ago
On Nov 15, 8:33 pm, "Marco Shaw [MVP]" <marco.shaw@NO_SPAMgmail.com> wrote: > By default with version 2, powershell.exe runs in STA mode, you can very > easily start it in MTA by passing the flag "-mta" to powershell.exe when > starting it.  powershell_ise.exe runs exclusively in MTA though. > > Marco > > "Martin Zugec" ...

 

Top contributing authors

Name
Posts
CodeSlinger
4
user's latest post:
I thought Powershell was MTA (V2...
Published (2009-11-15 19:13:00)
&nbsp; Actually to be clear, you can't put the actual event in the session. I know, I tried. I actually put an object and the event is a public member. - Dave &quot;CodeSlinger&quot; wrote: &gt; OK I figured it out. &gt; &gt; Instead of hard waiting on a ManualResetEvent which locks up the script main &gt; thread, I have my application create a plain old ordinary event, put that in &gt; a session variable...
Martin Zugec
1
user's latest post:
I thought Powershell was MTA (V2...
Published (2009-11-15 13:41:00)
&nbsp; Hi Dave, AFAIK (haven't played with it yet), Posh is STA only, to support MTA, you will need to use jobs for that (Posh v2 only) Easiest way to confirm that is to play with FileSystemWatcher. Martin &quot;CodeSlinger&quot; &lt;CodeSlinger@discussions.microsoft.com&gt; wrote in message news:64BD25C6-467F-4544-B657-F51FC7ED2D93@microsoft.com... &gt; Sorry if this doubles posts but the Windows Vista x64 forum...
Oisin (x0n) Grehan [MVP]
1
user's latest post:
I thought Powershell was MTA (V2...
Published (2009-11-15 20:32:00)
&nbsp; On Nov 15, 8:33?pm, &quot;Marco Shaw [MVP]&quot; &lt;marco.shaw@NO_SPAMgmail.com&gt; wrote: &gt; By default with version 2, powershell.exe runs in STA mode, you can very &gt; easily start it in MTA by passing the flag &quot;-mta&quot; to powershell.exe when &gt; starting it. ?powershell_ise.exe runs exclusively in MTA though. &gt; &gt; Marco &gt; &gt; &quot;Martin...
Marco Shaw [MVP]
1
user's latest post:
I thought Powershell was MTA (V2...
Published (2009-11-15 18:07:00)
&nbsp; By default with version 2, powershell.exe runs in STA mode, you can very easily start it in MTA by passing the flag &quot;-mta&quot; to powershell.exe when starting it. powershell_ise.exe runs exclusively in MTA though. Marco &quot;Martin Zugec&quot; &lt;martin.zugec@gmail.com&gt; wrote in message news:8E02466D-E3D9-4342-8A72-5B74EB9BB6E8@microsoft.com... &gt; Hi Dave, &gt; &gt; AFAIK...

Related threads on "Discussions in microsoft.public.windows.powershell":

Related threads on other sites:

Thread profile page for "I thought Powershell was MTA (V2 of PS and V2 of this post) in microsoft.public.windows.powershell" on http://www.microsoft.com/communities/newsgroups.... This report page is a snippet summary view from a single thread "I thought Powershell was MTA (V2 of PS and V2 of this post) in microsoft.public.windows.powershell", located on the Message Board at http://www.microsoft.com/communities/newsgroups.... This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity