How to Integrate PowerShell with VSCode

Here’s a quick guide to integrate PowerShell into VSCode and some of the extensions that can be used.

  1. Install VSCode
  2. Open VSCode as an Admin
Add PowerShell Extension

From the VSCode console you need to add the PowerShell extension for integration with VSCode, you can add the extension in the following ways

  • File>Preferences>Extensions
  • Crtl+Shift+X

The Extension sidebar will appear and prompt to search

  • Type PowerShell (There are multiple extensions)
  • Select PowerShell Language Suppport for Visual Studio Code and click Install

PowerShell Classic ISE Integration

In VSCode you can integrate the classic ISE (Integrated Scripting Environment). This is optional and is not required as part of the PowerShell integration with VSCode.

In VSCode do the following:

  • Ctrl+Shift+P
  • Select the option PowerShell: Enable ISE Mode

You’ll see a preview of the PowerShell cmdlets appear on the left-side. This indicates that the ISE is now present.

  • Click File>New File

You’ll see the classic start icons for PowerShell ISE appear in VSCode

Switch Between Different PowerShell Versions

If you have both PowerShell 5.1 and PowerShell Core Installed you can switch between the versions in VSCode. This is useful to know as there differences between the two

In the bottom right of the screen identify the version of PowerShell currently running in VSCode

  • Click on PowerShell, in this example it’s 5.1
  • Switch to the version of PowerShell to integrate with VSCode.
Further References

PowerShell Integration with Visual Studio Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s