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 specified, 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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758199429, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-line-parameters/STA-MTA(50): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78