If you’re a PowerShell user and a fan of the Integrated Scripting Environment (ISE), you now have the option to flick on ISE mode in Microsoft’s Visual Studio Code (VS Code) cross-platform code-editing tool.
The latest update to VS Code follows Microsoft’s generally available version of PowerShell 7 for Windows, macOS, and Linux. PowerShell 7, which could have been named PowerShell Core 6.3, is based on .NET Core 3.1 rather than .NET Framework.
These changes have also impacted the PowerShell Preview extension for VS Code, allowing Microsoft to deliver improvements in the latest preview.
The new PowerShell extension preview for VS Code includes a ‘switch’ that developers can flick on in VS Code to replicate the ISE experience in PowerShell version 6 and below.
SEE: How to build a successful developer career (free PDF)
ISE is no longer supported in the PowerShell extension for VS Code even though Windows still ships with ISE. Now users need VS Code with the PowerShell extension and can type a simple editor command to enable or disable ISE Mode.
The PSReadLine module with syntax highlighting, multi-line editing, and back search is also now part of the VS Code integrated console for Windows, macOS, and Linux, satisfying a top user request, according to Microsoft.
Microsoft notes that PSReadLine was a “among our most difficult problems” to solve due to architectural changes to how the PowerShell extension manages threading and runspaces. That’s why it was continually delayed.
“In January of 2019 we released a Preview version of the PowerShell extension, which was built on .NET Standard thereby enabling us to support PSReadLine in the integrated console for Windows users on PowerShell Version 5.1 and above,” explains Sydney Smith, a program manager on Microsoft’s PowerShell team.
“With PowerShell 7 delivering a fix in .NET Core 3.1 for the way POSIX terminal APIs are handled when starting new processes, we are finally able to move the PSReadLine support currently available in the PowerShell Preview extension into the stable PowerShell extension with support across platform distributions.”
SEE: Microsoft’s PowerShell 7 is generally available
However, PSReadLine support in the PowerShell extension has created breaking changes because the updated version doesn’t support PowerShell versions 3 and 4. Future updates to the VS Code PowerShell extension will no longer support these versions of PowerShell.
Microsoft has also delivered performance improvements to the VS Code editor and debugger for PowerShell. Architectural changes built over the past six months should ensure there are far fewer crashes and that the extension catches and logs bugs.
Smith also promises that the changes to CodeLense will greatly improve the responsiveness of IntelliSense, Microsoft’s code-completion tech in VS Code.