Blog of Tips, Tricks & Resources from New Horizons Central

Nicole Winn

Visual Studio Code | Expert Resources & Extensions

Charles Watkins gives you the run-down and excellent summary of Visual Studio, with direct resources. Microsoft got it right.

 


 

Visual Studio Code (VS Code), by Microsoft, is a FREE small lightweight code editor that can be installed on Windows, MacOS, and Linux.  VS Code is not an Integrated Development Environment (IDE) like Visual Studio but it has many IDE-like features.

VS Code made is debut of April 2016. It has support for many of the necessary features needed to develop in today's ever changing environment. VS Code supports, syntax highlighting, code refectory, debugging, embedded Git, intelli-sensce, and snippets.

Instead of the Solution/Project system of development, we find with Visual Studio, VS Code uses open directories, which can be saved as "workspaces".  Using "workspaces" allows developers and administrators to compartmentalize the management of all of their code.

VS Code has built-in support for Type-Script, Node.js, and JavaScript, but it is the extensive community of extensions that make this code editor so exciting.

VS Code can be installed normally using the Visual Studio Code Installer(https://go.microsoft.com/fwlink/?LinkID=534107) or as a portable configuration using the zip file (https://code.visualstudio.com/docs/?dv=winzip). The portable installation can be loaded onto a usb or external drive.  One tip concerning the portable installation.  After you have unzipped the files for VS Code to your desired location and before you run VS Code for the first time; create a folder named "DATA" in the root folder of the expanded files.  This "DATA" folder will contain all of the extensions that you will install later.

This VS Code configuration will make the portable installation transportable.  You will need .NET Framework 4.5.2 or higher to run VS Code. 

If you choose the normal installer, the setup will add VS Code to your %PATH%.  If you choose the portable installation you may consider adding the "code.exe" or "code - insiders.exe (Insiders edition)" to your %PATH%.  This will allow you to run the "code" or "code - insiders" from a command line.

An example of why I think VS Code is going to be pivotal to those involved in the Windows Universe (Windows OS, on-prem MS Server Solutions and Azure) going forward is Powershell.  Powershell is a required skill for anyone desiring to be a Windows / Azure professional.

Powershell v.1 through v5.1 can be managed using the Integrated Scripting Environment (ISE), which is a nice easy to use development environment for Powershell.  However, Powershell v.6 and above have been opened sourced and now runs on Windows, MacOs and Linux.  The Integrated Scripting Environment (ISE) does not support Powershell v6+ and is not supported on MacOs or Linux.  This means that if you desire a GUI environment for Powershell v6+ it will have to be VS Code.

 

Now, more about the extensions.

 

Out of the box, VS Codes just seems to work.  There is a small learning curve because of the settings and configuration but after you spend a little time with it, I think you will grow to love it. I know, I have been assimilated! LOL

VS Code extensions add new features, themes, languages, debuggers, and much more to the coding experience with the code editor. There are several thousand extensions in the Visual Studio Code MarketPlace (https://marketplace.visualstudio.com/VSCode).  VS Code allows you to search for and install the extensions of your choice.  An extension can be installed and configured, disabled or uninstalled without effecting other non-dependent extensions. 

Select the Extension icon on the left "Activity Bar" or click the "View" menu and select "Extension" or press "Ctrl+Shift+X" in Windows to bring up the "Extension pane". You will see a list of the most popular extensions in the Visual Studio Code Marketplace. Each of the listed extensions will have a brief description, a five-star rating, a download count, and a publisher displayed. You will also be able to see if you have already installed the extension.  If the green install button is present, you have not installed the extension. If the green button is missing you have installed the extension. The extension's details page contains the README, contributions, changelog, and dependencies.

Some of the most popular extensions deal with Python, Powershell, and Azure.  There are also extensions that support Windows containers, C/C++, C#, Data Science, visualization, even Amazon Alexa.

Two extensions for the Windows/Azure professional are "Powershell Preview" (Powershell 5.1 and up) or "Powershell" (Stable) and "Bracket Pair Colorizer 2". If you install both Powershell extensions, only one of them can be enabled at a time.  The Powershell extensions will give you very good language support.  You can write and debug Powershell scripts using the Visual Studio Code interface. "Bracket Pair Colorizer 2" allows the matching bracket to be identified with colors.  Bracket works great out of the box but can be configured to your liking. 

In the Visual Studio Code MarketPlace, there is an extension for "Azure CLI" called "Azure CLI Tools".  "Azure Command-line Interface" is a set of commands used to create and manage Azure resources. Like Visual Studio Code, Azure CLI can be installed on Windows, Linux and MacOS as well as run in Docker and the Azure Cloud Shell.   "Azure CLI Tools" (https://marketplace.visualstudio.com/items?itemName=ms-vscode.azurecli) supports IntelliSense, Snippets, an integrated terminal, side-by-side editor, and documentation on mouse hover.

You will need to install "Azure CLI" (https://aka.ms/installazurecliwindows) by using the msi or Powershell (Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi).  The Azure CLI can be run from the bash shell, cmd shell, or Powershell cli, all of which are available through the Visual Studio Code interface.

 

The Awesome Visual Studio Code

 

Visual Studio Code also supports developing cloud apps locally before you actually deploy them to the Azure Cloud.  Visual Studio Code has extensions for Azure Storage (https://azure.microsoft.com/en-us/services/storage/), Azure Functions (https://azure.microsoft.com/en-us/services/functions/) and Azure Cosmos DB (https://azure.microsoft.com/en-us/services/cosmos-db/).

You can configure automated deployments to the cloud.  The Deploy to Azure (https://marketplace.visualstudio.com/items?itemName=ms-vscode-deploy-azure.azure-deploy) extension allows you to set up continuous integration and delivery from your apps to the cloud using GitHub Actions or Azure Pipelines.

For those who use Python for automation, application development, and Data Science; you will be pleased to know that Python is the most downloaded extension from the Visual Studio Code MarketPlace. Visual Studio Code can be an excellent addition to your Python development tool chest.  Visual Studio Code supports extension packs. Extension packs represent a number of extensions listed together for installation ex. "Python extension Pack" that will install "Magic Python", "Python", "Jinja", and "Django". These extension packs can represent an easy effective way of install multiple extensions that facilitate a complete development experience.

The standard "Python" extension supports, IntelliSense, Linting, Code formatting, Debugging, Testing, Jupyter Notebooks, Virtual environments, and code Refactoring.

The "Python Preview" extension is another awesome python extension. This extension provides a unique visual debugging experience that makes it so much easier to see what is happening with your code.

The Live Share Extension Pack (https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) makes it possible to collaborate editing and debugging in real-time, including integrated audio and text chat.  This is accomplished with a single click installation of this extension pack.  After the installation of the extension pack, you will be able to perform remote code reviews, interactive lectures, technical interviews, quick assistance, and Mob programming (programming with more than two people using Visual Studio Code).

As you can see, the Visual Studio Code development environment allows you to easily transition from one language or activity to another without much trouble. Again, it will take a little time to get accustomed to it, but once you get your arms around the structure of the interface, it's true possibilities will become clear.  Visual Studio Code is updated every month, so there is always something new to try. I started using Visual Studio Code because of Powershell and a desire for a GUI to support Powershell-core, but now I use it as my go-to for all things Powershell, Azure, python, json, and xml. I have even started using it to write queries against Microsoft SQL Server. I cannot wait to see what the Visual Studio Code team has in store for us next.

It looks like Microsoft may have gotten this one right.

 


 

Charles Watkins is a regional trainer for New Horizons Central, based in Tennessee. He’s been training with New Horizons for over 24 years, teaching a wide variety of technical classes including (but not limited to) PowerShell, Python, Windows Server, and SQL.

Previous Article Microsoft Azure Employment Outlook
Next Article How to Create a Custom "Content Type" in a SharePoint Site
Print
347

Theme picker

Loader