Level 1
0 / 100 XP

Setting up Visual Studio Code for PowerShell

In this lesson, I'm going to show you how to download and install Visual Studio Code, and then how to set up your PowerShell development environment. Now, this is something that you can do instead of using the ISE.

A more modern approach is to switch over to Visual Studio Code. And some of the key advantages of that is just multi platform support as well as multi language support. So you can use the same editor to edit PowerShell files as well as Python files, JavaScript, C sharp and just about any other programming language that you can think of, you can use VS code to edit and create those and modify those scripts as well as debugging.

So really quick. What I'm gonna do is go to my search browser and I'm gonna search for Visual Studio code and, visual Studio Code is a cross platform editor by Microsoft. There's all kinds of cool things you get access to as far as extensions. It has a massive extension marketplace, which is what we're seeing here on the left hand side.

You get access to things like GitHub Copilot, which is… AI powered code, so it'll make AI suggestions. So if you're running a for each loop, for example, it will automatically suggest how the syntax should look. And most of the time it's pretty accurate. Every once in a while it's wrong. But this is just my preferred way of writing all of my code over the ISE and just thought I would show you how to do that. Now you don't have to install this for the course, but what I will say is that when we get to the sections where we're creating a power show module, this is really going to save you a lot of time having this set up just the way that it works.

And there's also a lot of shortcuts that you can't do in the ISE. Quickly replacing text, for example, in the VBS code, you can double click a certain string, hit control D and it'll automatically select all the matches of that string. So if you want to rename a variable, it's really fast.

You can do things like write on more than one line at…