Since I started using Visual Studio Code for creating PowerShell scripts, I added more extensions to it which make the look and feel better and make scripting easier. In this blog post, I will show you which ones I use and why. If you use certain extensions that you want to share, please leave a comment 🙂
How to install Extensions
In Visual Studio you can browse and install extensions by selecting the icon on the left toolbar or by pressing CTRL-Shift-X.
It’s always nice to have good-looking icons, Fluent Icons is a product icon theme that you can add and activate in Visual Studio Code. All icons, except the file icons (covered by file icon themes) and icons, contributed from extensions are from this site Link.
Edit your GitHub Gists (Link) from within Visual Studio Code, Gists are easy for storing code snippets, configurations, scripts, and notes. I use it to create and modify .md files which I edit using MarkDown language. (More information). For example, this is a Gist that I added using Gistpad:
Because of the MarkDown language, it looks like this in other programs or in the browser :
It’s just a nice way of storing your thoughts and code snippets without leaving your Visual Studio Code editor 🙂
When opening a file, it makes sections of it. When selecting a value from the left, it jumps to the line in the file itself. It also counts the values and makes editing JSON files easier because of the analysis of formatting.
The markdownlint extension is a source code formatter and makes sure you format your .md file with all the standards of the MarkDown language. While editing a .md file, it looks like this:
I started the file with two #’s, it should be only one # because it’s a top-level heading. It’s nice for formatting your file correctly although it can be tough sometimes because it’s pretty strict 😉
I use this because it’s a nice dark color theme for Visual Studio Code with these options:
Personally, I use the normal Night Owl with Italics, the Light version is way too light 😛 And that setting looks like this:
Makes sense of course to have this one installed, it provides support for editing the PowerShell scripts in Visual Studio Code. And for the PowerShell ISE lovers… You can set the Color Theme to match the ISE colors 😀
PowerShell Stack Overflow Search
Sometimes you need some help or examples on a certain cmdlet, when selecting Get-ADGroupMember for example in your script and pressing CTRL-Shift-F1 it will take you to their website and do a search of topics about it:
Run in Powershell
The screenshot says it all, it allows you to right-click your .ps1 file and run it in an external PowerShell prompt which is easy sometimes when working on a few scripts at the same time and debugging them.
I’m not the best at formatting XML files correctly, this extension helps me with that.. It displays it like this when viewing an Office 365 XML for example:
While editing and formatting using the Right-Click Format, I can easily see if I’m doing something wrong 😉