<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Weekend Scripter: Playing Around with PowerShell Namespace ApartmentState</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/09/weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx</link><description>Microsoft Scripting Guy, Ed Wilson, talks about exploring the Windows PowerShell namespace ApartmentState property.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Weekend Scripter: Playing Around with PowerShell Namespace ApartmentState</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/09/weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx#3551719</link><pubDate>Mon, 11 Feb 2013 17:04:27 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551719</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;By the way, if you launch Windows PowerShell in 2.0 mode by using: powershell -version 2 then PowerShell also starts in MTA mode.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551719" width="1" height="1"&gt;</description></item><item><title>re: Weekend Scripter: Playing Around with PowerShell Namespace ApartmentState</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/09/weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx#3551545</link><pubDate>Sun, 10 Feb 2013 20:56:30 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551545</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@Craig Lussier - yes changing PowerShell to STA mode by default in fact helps to avoid a lot of confusion, and for most things does not really hamper backward compatibility either.&lt;/p&gt;
&lt;p&gt;@Craig Lussier - I have done very little with SharePoint, and even less with specific SharePoint scripting so I am not the best person to comment on this. But thanks for sharing the insights.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551545" width="1" height="1"&gt;</description></item><item><title>re: Weekend Scripter: Playing Around with PowerShell Namespace ApartmentState</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/09/weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx#3551530</link><pubDate>Sun, 10 Feb 2013 18:29:31 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551530</guid><dc:creator>Craig Lussier</dc:creator><description>&lt;p&gt;Just one more comment - if a script or function is executed from a single line in PowerShell, it is executed in a single thread even in MTA mode. So for those in the SharePoint space, if you are calling a function/script from a single line in the PowerShell 2.0 console (i.e. not the SharePoint Management Shell), the entirety of the script/function is executed as a single thread and therefore thread safe so long as all pipeline operations are completed on the same line (thread).&lt;/p&gt;
&lt;p&gt;Ed, if you have anything to add to this please do.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551530" width="1" height="1"&gt;</description></item><item><title>re: Weekend Scripter: Playing Around with PowerShell Namespace ApartmentState</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/09/weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx#3551526</link><pubDate>Sun, 10 Feb 2013 18:13:10 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551526</guid><dc:creator>Craig Lussier</dc:creator><description>&lt;p&gt;Ed - Thanks for this blog. Coming from a SharePoint PowerShell perspective, having the shell default to STA is great as so many objects in the SharePoint stack are not thread safe. Often times in the field I see folks loading the Microsoft.SharePoint.PowerShell snappin in the PowerShell 2.0 console and executing scripts (instead of using the SharePoint Management Shell which defaults to STA) not realizing that the default is MTA which could cause issues. With PowerShell 3.0, defaulting to STA is a welcome change for the SharePoint crowd. &lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551526" width="1" height="1"&gt;</description></item></channel></rss>