Tag: Visual Studio

Write PowerShell Code Online in a web browser using Visual Studio Codespaces

Write PowerShell Online using Visual Studio Codespaces

Last week the Visual Studio Services team announced a new service called Visual Studio Codespaces. Visual Studio Codespaces allows you to do cloud-hosted development for wherever you’re working. While the new services support many different programming and scripting languages, it also supports PowerShell. In this blog post, I am going to show you how you can write PowerShell code online in a web browser using Visual Studio Codespaces.

What is Visual Studio Codespaces

As mentioned, Visual Studio Codespaces (earlier known as Visual Studio Online) are cloud-hosted development environments, which are accessible from everywhere. I don’t want to go too deep into what Visual Studio Codespaces are since there are already great resources out there. However, I want to quickly give you an overview of the basics of Visual Studio Code spaces and how you can use them to write PowerShell code.

Visual Studio Codespaces gives you access to development machines, which can be cloud-hosted or self-hosted.

  • Cloud-hosted machines are machines running in the Microsoft Cloud, and you can take advantage of the power of that machine. In this case, you can use the web browser or Visual Studio Code to access that Codespace.
  • Self-hosted machines can be computers in your home, company, installed in the cloud using Azure VMs, or everywhere. Again, here you can use a remote machine using a web browser or VS Code to access that code space remotely.
Visual Studio Codespaces Overview

Visual Studio Codespaces Overview

This now allows you to have a powerful development environment that you can access and run from anywhere. I think that is pretty cool!

You can read more about the introduction of Visual Studio Codespaces here.



Microsoft Teams Video Call

How to host Tech Workshops and Trainings online

I just got asked by one of my blog readers, who is a consultant and trainer, about what tools I use to give online tech workshops and trainings. I thought this would make a good blog post; that’s why I want to share with you how you can provide tech workshops and trainings online. This can obviously also be used in day to day collaboration and meetings.

How to give Workshops and Trainings online

In my previous job, I worked with a lot of customers and provided workshops and trainings. Here are some of the tools I used, and I am still using. I know that there are a lot more applications out there which can give you a great experience. Some of them are optimized for public streaming, others for collaboration. The same is true for my list; depending on the use-case, meeting, workshop, or content you have, maybe one tool is better than the other. So have a look at these tools and decided which one works best for your workshop or training. I also need to point out that you can use them not just as a standalone app, but also in combination with each other.

Microsoft Teams

The first tool which pops in mind and is the one I use the most is Microsoft Teams. Microsoft Teams is a fantastic collaboration tool. It lets you do a couple of things like meetings and video calls with screen sharing and PowerPoint presentations as well as included whiteboard experience. In addition to meetings and chats, you also get a rich collaboration space with teams and channels, which you can also use to share workshops and training material over time. You can provide an excellent experience for your customers and team members even after the workshop or training is done. There are many features in Microsoft Teams. The best thing is to check out the product page to see all the capabilities of Microsoft Teams. You can invite people outside of your organization as guest accounts to have a collaboration space.

Microsoft Teams Video Call

Microsoft Teams Video Call

I want to share two of the live chat and video experiences that you can use in Microsoft Teams for online meetings, trainings, and workshops.

Microsoft Teams Online Meetings – This is the experience most users probably are familiar with. With Microsoft Teams online meetings, you can host audio, video, and web conferences with anyone, and you get features such as scheduling assistance, meeting note-taking, screen sharing, meeting recording, and instant messaging.

Microsoft Teams Live Events – With Microsoft Teams live events you can broadcast video and meeting content to large online audiences. This can be inside and outside of your company. Live Events are meant for one-to-many communications where you are leading the interactions, and audience participation is primarily to view the content shared by you. Live events feature is excellent if you want to organize things like webinars. While the online meetings functionality has a chat, the live events comes with a Q&A feature, which makes it easy to keep track and answer questions.

If you want to learn more about how to present PowerPoint in Microsoft Teams, check out Sarah Lean’s blog post.

Microsoft Whiteboard

Another tool I use a lot is the Microsoft Whiteboard app, and I already wrote a blog post about why IT Pros should use the Microsoft Whiteboard app.

Microsoft Whiteboard

Microsoft Whiteboard

The Whiteboard app is a digital whiteboard that allows you to invite people online to collaborate in real-time. It also integrates into Microsoft Teams as well.

PowerPoint – Present Online and record Presentations

PowerPoint Present Online

PowerPoint Present Online

As mentioned before, you can use Microsoft Teams to share and present your PowerPoints. However, what a lot of people don’t know is that PowerPoint already has an integrated sharing feature. You can share and broadcast your PowerPoint presentation online directly within PowerPoint, without the need for an additional tool.

Present Online in PowerPoint

Present Online in PowerPoint

You can also record PowerPoint presentations and share them online later on.

Record Slide Show

Record Slide Show

 

Visual Studio Code Remote Share

When it comes to code, Visual Studio and Visual Studio Code (VS Code) offer you a feature called Visual Studio Live Share. Live Share allows you to share your code in real-time. You can collaborate and work with multiple people on the same code. New is that you can not only join using VS Code or Visual Studio, but you can now also join by just using a browser.

Invite people with Visual Studio Live Share:

Visual Studio Code Live Share

Visual Studio Code Live Share

Collaborate on the same file:

Sharing code online with VS Code Live Share

Sharing code online with VS Code Live Share

I hope this blog was helpful and gives you a couple of ideas on how you can provide workshops and trainings online as well as collaborating in real-time with people. Let me know if you have any questions in the comments. Thanks to Martin Dimovski, who gave me the idea of this blog post.



Visual Studio Code Azure Virtual Machines Extension

Create and Manage Azure VMs from VS Code

With the new Azure Virtual Machines (VMs) extension for Visual Studio Code (VS Code), you can now create and manage Azure VMs directly from VS Code. This is a great new extension if you are working with VS Code and Microsoft Azure. The extension is currently in preview and lets you view, create, delete, start and stop Azure Virtual machines, as well as adding SSH keys to existing Azure VMs.

Get started

To get started with the Azure Virtual Machine extension in Visual Studio Code, simply follow these steps:

  1. Download and install the Azure Virtual Machines extension for Visual Studio Code
  2. Once complete, you’ll see an Azure icon in the Activity Bar
  3. Sign in to your Azure account by clicking Sign in to Azure. If you don’t have an Azure account yet, you can create a free Azure account here.

Free Azure Account

If you don’t have an Azure account yet, you can sign up today for your free Azure account and receive 12 months of free popular services, $200 free credit, and 25+ always free services.

Create an Azure VM in VS Code

You can now create Azure VMs directly from Visual Studio Code. The wizard will ask you for a VM name, username, Azure region, and passphrase.

VS Code creating Azure Virtual Machines

VS Code creating Azure Virtual Machines

This will create an Azure VM Standard D2s V3 (2 CPU Cores & 8 GB of ram) with the image Ubuntu 18.04-LTS. An SSH key will be created, and your SSH Config file (~/.ssh/config) will be updated so you can immediately connect via SSH ($ ssh vm-name) or using the Remote-SSH extension. You can find more information about how you can connect to Azure VM using Visual Studio Code in my blog post.

Azure VM management in VS Code

Azure VM management in VS Code

Having the possibility to manage Azure VMs and connect with them directly within Visual Studio makes working with these tools and Azure much more convenient.

I hope you can go and try out the Azure VM extension for VS Code. If you have any questions, please feel free to leave a comment.



VSCode in Azure Cloud Shell

You can now run a Visual Studio Code based editor in Azure Cloud Shell

Azure Cloud Shell, a browser-accessible shell for managing Azure resources, just got even more powerful. Today Microsoft added a new Visual Studio Code editor to Azure Cloud Shell. Okay, it is not the real Visual Studio Code, it is an editor based on the Visual Studio Code open-source project Monaco. Monaco is the same web-standards based editor that powers Visual Studio Code, and the editor is now integrated directly into Cloud Shell.

Now you not only have editors like vim, emacs or nano, you also able to run code, directly with in the Azure Cloud Shell. This is pretty handy when it comes to quickly edit some files like scripts or ARM templates.

This is not the first time the Azure Cloud Shell team and the Visual Studio Code team collaborated: Azure Cloud Shell in Visual Studio Code



My Favorite Visual Studio Code Themes

While I am doing presentations, I often do demos, and since a lot of my demos are PowerShell based, I use a lot of Visual Studio Code. With that I often get the question which is the Visual Studio Code Theme I use. Even I change my Visual Studio Code Themes pretty often, I have a couple of favorites I want to share.

Azure Contrast (rainglow)

VS Code Theme Azure Contrast rainglow

Rainglow has a huge amount for different themes, my favorite one is their Azure, Azure Contrast theme.

Cobalt2

Visual Studio Code Theme Cobalt2

My current favorite Visual Studio Code Theme is Cobalt2. Cobalt2 is a dark but colorful theme for Visual Studio. I like it because it is a dark theme, but it not uses the classic dark grey background, instead I like the mix of dark blue and yellow.

Atom One Dark

Visual Studio Code Theme Atom One Dark

Atom One Dark is another Dark theme I started to like very much. I like the popping colors on the dark background.

Ayu Mirage – Visual Studio Code Theme

Visual Studio Code Theme Ayu Mirage

The Ayu Themes for Visual Studio are simple, bright and elegant themes. I prefer the Ayu Mirage theme which as I said looks very elegant. The Ayu themes also have other options like the Ayu light which is also one of my favorites.

Dracula

Visual Studio Code Theme Dracula

Dracula is one of the famous Visual Studio Code themes, which is also available on other platforms. When I am not using the Cobalt2 theme, I most often switch to Dracula.

Ayu Light

Visual Studio Code Theme Ayu Light

I mentioned the Ayu Themes before, and this is the light version of it. I am mostly using dark themes, but when I switch to a light theme, I mostly use Ayu Light.

PowerShell ISE

Visual Studio Code Theme PowerShell ISE

If you are coming form PowerShell scripting, you are already familiar with the PowerShell ISE. The PowerShell ISE theme bring you back in to the old school world and even gives you the PowerShell blue background terminal.

There are a lot of other great Visual Studio Code Themes out there. What is your favorite? Let me know in the comments!



Azure Cloud Shell

Azure Cloud Shell – shell.azure.com and in Visual Studio Code

Back in May Microsoft made the Azure Cloud Shell available in the Microsoft Azure Portal. Now you can use it even quicker by just go to shell.azure.com. First you login with your Microsoft account or Work and School account, and if your account is in multiple Azure Active Directory tenants, you select the right tenant and you will be automatically logged in. So even if you are on a PC where you can not install the Azure CLI or the Azure PowerShell module, you can still easily fire up a shell where you can run the Azure CLI, Azure PowerShell and other CLI tools like Docker, Kubectl, emacs, vim, nano, git and more.

In addition you can also open up Azure Cloud Shell directly from Visual Studio Code

Azure Cloud Shell Visual Studio Code

With that, enjoy your holidays and I wish you a good start in the new year!



PowerShell for Visual Studio Code

PowerShell for Visual Studio Code 1.0 – Your improved PowerShell ISE

Microsoft yesterday not only announced the new Azure Cloud Shell, Azure PowerShell 4.0, they also announced something I was waiting for a long time. Microsoft finally announced the version 1 of the PowerShell for Visual Studio Code with a lot for great enhancements. David Wilson describes this on the PowerShell Team blog.

This supports the PowerShell development on the following platforms:

  • Windows 7 through 10 with PowerShell v3 and higher
  • Linux with PowerShell v6 (all PowerShell-supported distributions)
  • macOS and OS X with PowerShell v6

Features:

  • PowerShell ISE-like interactive development experience with the PowerShell Integrated Console
  • Rich debugging experience including variables view, call stack, watch window, and various breakpoint types
  • Integrated script analysis and code fixes provided by PSScriptAnalyzer
  • Code navigations that allow you to find definitions and references of functions across your script files
  • Highly configurable code formatter based on community best practices
  • New file and project creation using Plaster templates
  • Editor scripting API through the $psEditor object model

The biggest thing about this for me, is the support to run code line by line, which will help a lot in demos and presentations.

So what does this mean for the PowerShell ISE?

The PowerShell ISE has been the official editor for PowerShell throughout most of the history of Windows PowerShell. Now with the advent of the cross-platform PowerShell Core, we need a new official editor that’s available across all supported OS platforms and versions. Visual Studio Code is now that editor and the majority of our effort will be focused there.
However, the PowerShell ISE will remain in Windows supporting Windows PowerShell with no plans to remove it. We will consider investing effort there in the future if there is a high demand for it, but for now we think that we will be able to provide the best possible experience to the PowerShell community through Visual Studio Code.

Really looking forward to work with PowerShell for Visual Studio Code.