-MTA
and -STA
specifiy the apartment model (multi threaded or single threaded). -STA
. C:\> powershell -c [System.Threading.Thread]::CurrentThread.GetApartmentState() STA C:\> powershell -STA -c [System.Threading.Thread]::CurrentThread.GetApartmentState() STA C:\> powershell -MTA -c [System.Threading.Thread]::CurrentThread.GetApartmentState() MTA