Errors with PS1 script

Hello,

I face the same Error regarding STA.

I’ve checked the STA setting in PowerShell Tools options, Powershell Version is set to "Windows PowerShell (x64), but the error is still there.
I am using VS 2019 Enterprise, PowerShell Tools Pro (latest verison), PS 7.0.2 x64 is installed, too.

Any suggestions?

Thank you in advance, Robert