I’m getting the following error when I execute a command interactively in the PowerShell Interactive Window in VS 2019:
PS C:\Users\Steve James> Stop-Process -Id 16496 -Confirm
[ERROR]
[ERROR] Stop-Process: The calling thread must be STA, because many UI components require this.
I’ve selected PowerShell 7 (x64) and enabled Single Threaded Apartment State (STA) in Options.
Any ideas what is wrong?