How To Make Visual Studio Code Look And Behave Like The PowerShell ISE
Tags: powershell
Published: 2021-01-14 23:12:40

> _This article was written by Jeff Christman. He is a frequent contributor to the Adam the Automator (ATA) blog. If you'd like to read more from this author, check out his [ATA author page](http://adamtheautomator.com/author/jeff). Be sure to also check out [more how-to posts on cloud computing, system administration, IT, and DevOps on adamtheautomator.com](https://adamtheautomator.com)!_

<!-- wp:paragraph -->
<p>Despite its lack of features and options, the PowerShell ISE used to be the primary PowerShell IDE tool to develop and edit <a href="https://adamtheautomator.com/tag/powershell/">PowerShell</a> Scripts. It offered an integrated development environment (IDE) that included some basic features to build scripts and modules.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Microsoft is no longer actively developing the PowerShell Integrated Scripting Environment (ISE) and is being replaced by the more powerful and versatile open source Visual Studio Code (VS Code). With its ever-expanding options and extensions, VS Code is quickly becoming the new standard tool for developing not only PowerShell, but just about any other language you choose.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Despite all the new features available in VS Code, leaving the familiar environment of the ISE is difficult. It is like watching your child go to college. You are proud of the achievement but sad about having left a comfortable environment.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>VS Code can be intimidating at first. As the default settings of VS Code can be a little hard to work with if you are used to working with the ISE. However, it's highly customizable, and with the addition of Extensions and a few configuration settings, you can make VS Code look and behave just like PowerShell ISE.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you're more of a visual learner, be sure to check out this posts associated TechSnips how-to video.</p>
<!-- /wp:paragraph -->

<!-- wp:embed {"url":"https://www.youtube.com/watch?v=Ar6YSFC0xBE","type":"video","providerNameSlug":"youtube","responsive":true,"align":"center","className":"wp-embed-aspect-16-9 wp-has-aspect-ratio"} -->
<figure class="wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
https://www.youtube.com/watch?v=Ar6YSFC0xBE
</div></figure>
<!-- /wp:embed -->

<!-- wp:heading -->
<h2 id="the-look">The Look</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>To get VS Code to look like PowerShell ISE, the PowerShell Extension needs to be installed. To install, select the setting gear at the bottom left, then pick <em>Extensions</em>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>At the search box, type in <em>Powershell</em> and then install. This extension adds a few features to the default settings of VS Code.</p>
<!-- /wp:paragraph -->

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a5lj03lrefh76mujnval.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2pa7zrkk6c2f3j071pkq.png)

<!-- wp:paragraph -->
<p>To get the distinctive look of PowerShell ISE, select the settings gear and then <em>Color Theme</em>. Choose the<em> PowerShell ISE</em> theme.</p>
<!-- /wp:paragraph -->

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bybuospp8a5qkk4p5khg.png)

<!-- wp:paragraph -->
<p>Now that you have the look of PowerShell ISE, we need to set the behavior to match ISE.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="the-behavior">The Behavior</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The default install of VS Code lacks some features of the PowerShell ISE, such as Zoom, Tab-Completion, Intellisense, and Code Snippets.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For setting the environment to match that of PowerShell ISE, we need to add some environment settings to the VS Code settings.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 id="keyboard-and-mouse-actions">Keyboard and Mouse Actions</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Open the command palette using the <em>ctrl+Shift+P</em> key combination. In the command palette box, enter <em>Preferences Open Settings (JSON)</em>. This will open up a two-pane window with the user settings on the right. Insert the following code between the brackets on the right pane.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code lang="json" class="language-json">"editor.mouseWheelZoom": true,
"editor.minimap.enabled": false,
"editor.renderControlCharacters": true,
"editor.wordWrap": "on",
"files.trimTrailingWhitespace": true,
"files.autoSave": "afterDelay",
"powershell.integratedConsole.showOnStartup": false,
"terminal.integrated.fontFamily": "Consolas",
"terminal.integrated.fontSize": 18,
"terminal.integrated.shell.windows": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe", "powershell.powerShellExePath": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe"</code></pre>
<!-- /wp:code -->

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gd92jd7k2ys5it59qme3.png)

<!-- wp:heading -->
<h2 id="code-snippets">Code snippets</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>One of the best features of PowerShell ISE is the ability to use Code Snippets. VS Code has made code snippets more versatile.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To add code snippets, select the setting gear and then pick <em>User Snippets</em>. In the command palette, enter <em>powershell.json</em>. I've created a sample user snippets JSON file for you available <a href="https://github.com/TechSnips/SnipScripts/blob/master/How%20To%20Make%20Visual%20Studio%20Code%20Look%20And%20Behave%20Like%20The%20PowerShell%20ISE/PowerShel.json">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="summary">Summary</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>VS Code is now the preferred PowerShell editor. With a few customizations, we can make it behave just like the familiar PowerShell ISE.</p>
<!-- /wp:paragraph -->