The update amounts to a complete overhaul of the core PowerShell engine.

Microsoft has made extensive changes to the core PowerShell engine to create a more reliable and stable user experience, the companhy says.

The release of the updated PowerShell extension in VS Code includes a rewrite of PowerShell pipeline execution with cancellable and ordered tasks. It also includes many debugger reliability improvements, a ReadKey fix that includes better pasting on macOS and Linux, and many more improvements. 

Previously, the integrated Console was run by setting threadpool tasks on a shared main workspace which lead to threading issues and a complex implementation intended to work around the asymmetry between PowerShell as a runtime and as a language server. 

Sydney Smith, the Product Manager for PowerShell, detailed the update in a blog post. “This update represents a complete overhaul of the core PowerShell engine of PowerShell Editor Services, intending to create a more reliable and stable user experience,” she writes. “It is our response to many issues opened by users over the last several years.”

Smith offers a “huge thank you” to all of the community members who have tested these changes to the extension and have worked with Microsoft to polish the extension before releasing it through the MS stable channel.

Focus on the threading model

To improve the user experience, Microsoft focused on the threading model for the extension.

Previously the Integrated Console, the shell that is provided by the PowerShell extension, was run by setting threadpool tasks on a shared main runspace, and where LSP, Language Server Protocol, servicing was done with PowerShell idle events.

Now, PowerShell Editor Services maintains its own dedicated pipeline thread, which is able to service requests similar to JavaScript’s event loop, meaning we can run everything synchronously on the correct thread.

“This change has overhauled how we service LSP requests,” Smith says. It also changed how the Integrated Console works, how PSReadLine is integrated, how debugging is implemented, how remoting is handled, and “a long tail of other features in PowerShell Editor Services,” she adds.

Also read: How-to run Android apps on Windows 11 in the EU.