Migrate from Powershell ISE to Visual Studio Code
Most that code in PowerShell are most likely familiar with the PowerShell ISE. The Powershell ISE has been included since PowerShell 2.0 and definitely was/has been the go to tool for editing and writing Powershell code. If you are like me however, the Powershell ISE has been showing its age. Recently, I set out to look for a replacement editor to use to write and modify PowerShell code. Working on another project recently lead me to use Visual Studio Code to do some script writing. From the start, I was really impressed by the features and capabilities of this “free” tool from Microsoft. I have migrated from using PowerShell ISE to using Visual Studio Code. I will explain some of the reasons for doing so below. ย Let’s look at a quick post on how to Migrate from PowerShell ISE to Visual Studio Code.
Migrate from PowerShell ISE to Visual Studio Code
There is always a learning curve with anything new that we start using including software tools. ย This was the case for me with using Visual Studio Code. ย I had a lot of prior working knowledge of what I wanted to accomplish with VSS code coming from PowerShell ISE, however, had to translate this over to using the new platform. ย Why switch to Visual Studio Code from PowerShell ISE? ย As I hinted at above, Visual Studio Code is a much more modern feeling development platform for PowerShell than PowerShell ISE. ย While ISE has certainly been a workhorse, VSS Code feels modern and not so much a legacy platform from 2009. ย This includes powerful features like:
- Built-in Git integration
- Intellisense for multiple languages
- Tons of extensions that are easily installed both for Themes and functionality
- Tasks
Installing Visual Studio Code
To download Visual Studio Code, go to the download page here. ย Once you pull down the installer, simply run through the “Next, Next, Finish” installer.
The interface is slick and snappy.
The first thing you will want to do is click on the last icon in the sidebar for theย Extensions Marketplace and type in “PowerShell” or similar to bring up the available installs. ย Click theย Install button.
Once installed, you click theย Reload button that appears after the installation is complete.
Clickย Reload Windowย on the box that pops up.
One thing that was a bit non intuitive to m was that I needed to select PowerShellย as the language I was working with. ย This is the case if you are simply beginning a new file that has no extension as of yet. ย I noticed that I had no PowerShell intellisense when I started and took a bit to figure out why. ย Click the language at the bottom right hand corner of the Visual Studio Code window.
It will launch the Select Language Mode window. ย Simply type PowerShell here or scroll down to find it. ย After selecting PowerShell, Intellisense should work as expected. ย This will be on by default if you open aย .PS1 file.
Visual Studio Code Git integration
By default, out of the box, Visual Studio Code is integrated with Git without any extensions installed, etc. ย However, you do need to install Git on your workstation for it to integrate with it. ย Below is the Source Control option before having Git installed.
Once Git is installed, when you go back to your Source Control, you will be prompted to initialize your Git repository. ย After that, you are up and running with Git integration with the ability to connect to your remote Github, etc.
Visual Studio PowerShell Code Look and Feel
The look and feel of VSS Code is amazing. ย Everything looks great even in the Default theme. ย There are several other free themes that are amazing as well including the Atom One Dark Theme.
You can select your available themes, or you canย Install Additional Color Themes.
Thoughts
So far, I haven’t missed PowerShell ISE since moving over to Visual Studio Code as my preferred ย editor for PowerShell code. ย Hopefully, the few tidbits above on how toย Migrate from Powershell ISE to Visual Studio Code will help others who want to take the plunge and start using this great little free tool from Microsoft.