Microsoft VS Code reached the 1.0 milestone and announced Version 1.0 of Visual Studio Code.
It is code editing redefined. Plus, PowerShell support for syntax highlighting ships in the box, and you need to install the extension (see VS Code Extensions to see how to) to get the rest, intellisense, debugger and much more.
I’ve been lucky to be involved with the PowerShell Editor Service, I’ve made contributions to it and have be around many great conversations about features now and to come.
Here is the
Expand Alias feature I contributed.
VS Code launched a year ago, there have been 2 million installs of VS Code. There are more than 500,000 people actively using VS Code each month.
- Intelligent editing
- Powerful debugging
- Built-in Git support
- Hundreds of extensions
What started as an experiment to build a production quality editor using modern web technologies has blossomed into a new kind of cross-platform development tool, one that focuses on […] productivity by centering the product on rich code editing and debugging experiences.
Besides the fact that I can a huge amount of work for PowerShell in VS Code, I found this next part really cool.
I’ve been doing more work in Azure and after I did a PaaS deployment of an App Service, I exported the configuration from the Azure Portal to a zip file.
The zip had five files,
template.json. I extracted the files and then typed
code . to launch vs code telling it use the current directory as my “project”.
Here’s where it gets cool, there are 4 different file types in that Azure export. A PowerShell file, Linux Shell file, a C# file and JSON files.
NOTE: I have these two Visual Studio Code extensions installed C# and Azure Resource Manager Tools.
From VS Code, I clicked on each file and VS Code provided me syntax highlighting, and intellisense for the PS1 and C# files and for the JSON files, because they are ARM templates, the Azure Tools extension gave me intellisense based on the ARM schemas defined.
Check it out
Editing four different file types, supporting syntax highlighting and more.
All in one place I could easily edit each file and in the case of the PowerShell script, I could run it from vs code, debug it and get all the intellisense I expect from other environment.
VS Code Extensions
It is super easy to get these extensions in your environment too. After installing vs code, run it. For example, from a PowerShell prompt type
code and press enter. After it launches, press
F1. This will give you a dropdown at the top, it’s called the
command palette, something you’ll use a lot. Next, type
ext inst, press enter. This will query the
Visual Studio Code Marketplace for published extensions.
When the list is returned, you can start typing the name of the extension you want, the list will update with matches. Type
powersh. Next to the highlighted selection, you should see some blue boxes, you can click on the
License to read about these details or the
Cloud and Arrow to download and install the extension. After it is installed, VS Code needs to restart and will prompt you if you want to do it now or defer to later.
Once installed and restarted the extension, when you edit a PowerShell file you’ll have even richer features at your fingertips. Repeat this to install the C# and Azure Manager Tools extension. Also, browse through the list to see what other extensions meet your needs.
VS Code Pandoc
This is a vs code extension that I wrote and published. I work a lot with
markdown files. Visual Studio Code not only supports editing these files, it also has a live preview of them.
I ran across a free tool called Pandoc it renders
markdown into amazing number of formats. The ones I’m interested in,
Word Docs and
NOTE: If you want to render to
PDF you need to install MiKTeX for pandoc to generate it.
Install Follow the instruction in VS Code Extensions, search for
pandoc and install.
Here’s what the interaction looks like when rendering
markdown to other formats in VS Code.
Check out vscode-pandoc in the market place.
Visual Studio Code is a very impressive editor. For PowerShell, I’ve opted to do more of my PowerShell scripting in vs code. Yes, there are pieces missing, but not for long. Plus, if you are editing more than one type of file in your day, it’s worth checking out vs code. The sooner you do, the sooner you’ll find the moved cheese and be more productive.
NOTE: We haven’t even talked about how easy it is to create vs code extensions to fit your workflow.