0

I'm trying to port some scripts from poweshell 5.0 to the new pwsh powershell 6 and i've noticed that there is no -sta parameter anymore. How can I set the ApartmentState of pwsh? I can;t find anything about it and it looks like it's defined in compile time to be either mta or sta depending on the target plattform. Am i right?

C:\WINDOWS\system32>pwsh -sta
The argument '-sta' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

C:\WINDOWS\system32>powershell -sta
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Marco
  • 984
  • 10
  • 18

1 Answers1

0

Since the ...core components are designed to work across multiple platforms I think you are going to find windows-specific concepts are not included. If you need cross-platform compatibility you will need to find another way. If you don't use powershell and realize that it is going to slowly fall behind in available features as pwsh move ahead.

No Refunds No Returns
  • 8,092
  • 4
  • 32
  • 43