, , ,

How to use PowerShell ISE Mode in Visual Studio Code

1–2 minutes
6 comments on How to use PowerShell ISE Mode in Visual Studio Code
PowerShell ISE Mode in Visual Studio Code

If you are writing PowerShell code, you might have realized that there weren’t really improvements to the PowerShell Integrated Scripting Environment (PowerShell ISE) in the last couple of releases. With PowerShell becoming more popular on cross-platform systems, Visual Studio Code (VS Code) becomes the editor of choice. However, by default Visual Studio Code has a different behavior than the PowerShell ISE. To make it even easier, the latest PowerShell extension for Visual Studio Code, now includes PowerShell ISE Mode. PowerShell ISE Mode in Visual Studio Code, helps you to replicate and enable the settings from the following Microsoft Docs article: How to replicate the ISE experience in Visual Studio Code.

The ISE was first introduced with Windows PowerShell V2 and was re-designed with PowerShell V3. The ISE is supported in all supported versions of Windows PowerShell up to and including Windows PowerShell V5.1.

The PowerShell ISE is no longer in active feature development. As a shipping component of Windows, it continues to be officially supported for security and high-priority servicing fixes. We currently have no plans to remove the ISE from Windows.

There is no support for the ISE in PowerShell v6 and beyond.

How to enable PowerShell ISE Mode in VS Code

PowerShell ISE Mode VS Code

To enable ISE Mode in Visual Studio Code, you simply install the latest PowerShell VS Code extension and now you can simply start ISE mode from the command palette (cmd/crtrl+shift+p), by typing “Enable ISE Mode”. PowerShell ISE Compatibility Mode is available in the VS Code PowerShell extensions v2020.3.0, which also includes improved support for PowerShell 7. You can find more information on what’s new in PowerShell 7 on my blog.

You can find many blog posts and Microsoft Docs articles describing the settings to make VS Code look and behave like PowerShell ISE.

I hope this gives you a good overview of how you can move from your traditional PowerShell scripting environment to a new one based on the Visual Studio Code editor. If you want to know more or have any questions please let me know in the comments below.

6 responses

  1. István Antal Avatar
    István Antal

    It doesn’t works for me

    3/6/2020 1:30:18 PM [NORMAL] – pwsh.exe started.
    3/6/2020 1:30:18 PM [NORMAL] – Waiting for session file
    3/6/2020 1:31:32 PM [ERROR] – : Unable to instantiate; language client undefined.
    3/6/2020 1:32:18 PM [NORMAL] – Error occurred retrieving session file
    3/6/2020 1:32:18 PM [NORMAL] – Language server startup failed.
    3/6/2020 1:32:18 PM [ERROR] – The language service could not be started:
    3/6/2020 1:32:18 PM [ERROR] – Timed out waiting for session file to appear.

  2. Dom Avatar

    So useful thanks Thomas. Belated congratulations on the engagement :-)

  3. Cris Avatar

    Any way to make this the default when I open VS Code?

  4. Daniel Hug Avatar
    Daniel Hug

    Any way to undo this? :-D

    1. Thomas Maurer Avatar

      CTRL+Shift+P and then type “ise” and you will find “Disable ISE mode” :)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.