If you follow me on Twitter, then I’m sure you’re aware that I’ve been using nothing but VS Code (Visual Studio Code) as a replacement for the PowerShell ISE (Integrated Scripting Environment) for the past couple of weeks and while I had tried it in the past, I didn’t previously think it was ready for prime time. That’s now changed with all of the updates and work that has gone into it. From what I’ve found, it works fairly well flawlessly so I’ve created a short and simple video to help others get VS Code installed and configured as a replacement for the PowerShell ISE.
Let me know what you think and if you’d like to see more videos from me.
Update – I decided to add a brief summary of the video based on some of the feedback I received.
Go to code.visualstudio.com and download VSCode (Visual Studio Code) for your operating system. I also recommend downloading the version that matches your operating system’s architecture (32 or 64 bit). I take all of the default options during the installation.
Install the PowerShell extension for VSCode. I also like to install the vscode-icons extension.
Once the extensions are installed, reload VSCode by clicking the Reload button:
Click on the Gear on the bottom left and select Settings:
Enter the following settings on the right side of the settings screen.
1 2 3 4 5 6 7 8 9 10 | { "workbench.iconTheme": "vscode-icons", "workbench.colorTheme": "PowerShell ISE", "files.defaultLanguage": "powershell", "editor.formatOnType": true, "editor.formatOnPaste": true, "powershell.integratedConsole.focusConsoleOnExecute": false, "window.zoomLevel": 0, "editor.mouseWheelZoom": true } |
For more details, see the video.
µ
Thanks Mike! Very useful. Interested in learning more about what PSScriptAnalyzer can do in VSCode.
Awesome video Mike. Definitely going to pass this one on. Been using Code a while now myself and can’t imagine going back.
Only feedback I would give would be maybe checking the “Add Open with Code action …” options for both file and folder context during install, I don’t know of anyway to do it post install. I find them handy when I’m opening up my modules to work on them. Since VS Code is directory centric it’s really handy to open my module hierarchy all at once from file explorer. But from a “make it like ISE” perspective I can see where that might be out of the scope.
Thanks for the tip about editor.mouseWheelZoom option, that was new to me!
Thanks Mike. Very very helpful
Your video is awesome! However, could you please list the settings in your post. Thanks
Exactly what I am looking for…thank you and we done. I would love to see something on debugging and source control integration if you are compiling a list 🙂
Do you know if there is any way to incorporate the show-command like it is in the ISE. That was one of the great features that seems to be missing from visual studio code. Even when trying to just run show-command to open it there is an error in visual studio code.
Thanks in advance to any insight on this. Great video to get people going.
Thanks Mike, very interesting. I still have a couple concerns with VSCode that keep me in a “hybrid state”, with VSCode for serious PowerShell dev and the ISE for ad hoc work. The first is that the integrated shell still doesn’t let me do ctrl+c/ctrl+v. The second is that it bombs on -ShowWindow for Get-Help, which I use a lot.
Not sure if you have a pipeline to the @code team (or the PowerShell extension devs), but these improvements would likely get me to move over for everything.
Is it possible to make shortcut CTRL+R work like in ISE (switch between code and PShell)?
Thanks for sharing this Mike.
Very helpful. Thanks, Mike!
Thanks Mike! Looks really good.
Does it have a profile script to load functions I have created so they are available without having to load them every time?
Thank you for this video, Mike. I tried following along with a different video at first on YouTube but they were using a Mac and they weren’t explaining any of the hot keys they were using to get the results. You gave plenty of background information and explanation on what you were doing that it was a snap to follow along and understand what you were doing and why. I really appreciate the effort you put in to the video making it easy to understand.
Thanks a lot. I have just installed this and once I have started using it I will give feedback that hopefully will help you to help us. Muchos Gracias.
Nalin.