Search notes:

PowerShell command line parameters -MTA and -STA

The PowerShell command line parameters -MTA and -STA specifiy the apartment model (multi threaded or single threaded).
If not specifed, the value defaults to -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

See also

Other command line parameters
COM Apartments

Index