I've created a GUI application in Powershell. It's designed to use a RunspacePool to multi-thread its requests in the background, and this works perfectly fine from PowerShell natively.
However, when I convert the file to an EXE using PS2EXE, it needs to use Single Thread Apartment (STA) since it's a GUI. It gives me errors if I try and run it as MTA. And then when the EXE runs as STA, it performs its activities at a fraction of the speed it should, as if it is still just using one thread.
Is a STA not able to initialise other threads for background tasks? Or will I need to configure the application as a MTA but explicitly hang the user interface on its own thread?