This extension provides rich PowerShell language support for Visual Studio Code. Now you can write and debug PowerShell scripts using the excellent IDE-like interface that Visual Studio Code provides.
This extension is powered by the PowerShell language server,
PowerShell Editor Services.
This leverages the
Language Server Protocol
PowerShellEditorServices is the server and
vscode-powershell is the client.
Also included in this extension is the PowerShell ISE theme for Visual Studio Code. It is not activated by default, but after installing this extension either click "Set Color Theme" or use the theme picker and select "PowerShell ISE" for a fun and familiar experience.
Read the installation instructions to get more details on how to use the extension on these platforms.
Read the troubleshooting guide for answers to common questions.
You can install the official release of the PowerShell extension by following the steps in the Visual Studio Code documentation. In the Extensions pane, search for "PowerShell" extension and install it there. You will get notified automatically about any future extension updates!
code --install-extension PowerShell-<version>.vsix
NOTE: If you are using VS Code Insiders, the command will be
If you're on Windows 7 or greater with the PowerShellGet module installed, you can easily install both Visual Studio Code and the PowerShell extension by running the following command:
Install-Script Install-VSCode -Scope CurrentUser; Install-VSCode.ps1
You will need to accept the prompts that appear if this is your first time running
Alternatively you can download and execute the script directly from the web
without the use of
Install-Script. However we highly recommend that you
read the script
first before running it in this way!
iex (iwr https://raw.githubusercontent.com/PowerShell/vscode-powershell/master/scripts/Install-VSCode.ps1)
If you experience any problems with the PowerShell Extension, see the troubleshooting docs for information on diagnosing and reporting issues.
For any security issues, please see here.
There are some example scripts in the extension's
examples folder that you can
use to discover PowerShell editing and debugging functionality. Please
check out the included README.md file to learn more about
how to use them.
This folder can be found at the following path:
or if you're using the preview version of the extension
To open/view the extension's examples in Visual Studio Code, run the following from your PowerShell command prompt:
code (Get-ChildItem $Home\.vscode\extensions\ms-vscode.PowerShell-*\examples)[-1]
Check out the development documentation for more details on how to contribute to this extension!