Category: Windows 10

Customize Windows Terminal

My Customized Windows Terminal Settings.json

This is just a very quick blog post to share my customized Windows Terminal settings.json, and it should give you an idea of how you can customize the Windows Terminal for your needs. The new Windows Terminal for Windows 10 which is open-source and you currently can get it from the Windows Store. The new Windows Terminal lets you run different shells like Windows PowerShell, PowerShell 7, Command Prompt, WSL, and also WSL 2. It provides a couple of improvements like; multiple tabs support, GPU accelerated DirectWrite/DirectX-based text rendering engine, and much more. For me, one of the biggest advantages are the advanced customizing and configuration options, which allow you to configure the Windows Terminal settings using a profiles.json file.

Windows Terminal 1.0 was released on May 19, you can find more documentation here on Microsoft Docs.

I already shared a couple of blog posts on how you can customize your Windows Terminal experience:

Customized Windows Terminal Settings profiles json

Customized Windows Terminal Settings settings json



Azure Unblogged - Microsoft Feedback and Customer engagement programs

Azure Unblogged – Microsoft Feedback and Customer engagement programs

You might have seen that I started a video series called Azure Unblogged, in which I talk to people in Microsoft and the Microsoft community about different products, services, stories, and much more. This week I am releasing a video on Azure Unblogged in which I had the chance to talk to Holly Lehman (Program Manager in the Azure CxP Team) about Microsoft feedback and customer engagement programs. In this video, we talked about how vital feedback for Microsoft is and how the different teams are managing and capturing feedback.

You can watch the video on Microsoft Channel 9.

If you want to know more about the different insider programs at Microsoft, Check out the Microsoft Insider page for an overview of some of the programs that Microsoft offers for our customers to join!

You can also watch other episodes of Azure Unblogged on Microsoft Channel 9 and check out my blog at ITOpsTalk.com.

Let me know if you enjoyed the Azure Unblogged – Microsoft Feedback and Customer engagement programs video and if you have any questions, feel free to leave a comment. You can also subscribe to my YouTube channel here.



Add a PowerShell Remoting Session in the Windows Terminal Menu

Add a PowerShell Remote Session in Windows Terminal

I am sure you have heard about the new Windows Terminal, which is in preview, and you can get it from the Windows Store. In this blog post, I want to share how you can add a PowerShell remote session to the drop-down menu in the Windows Terminal when you open a new tab. The new Windows Terminal is highly customizable and it allows you to run different shells like the classic command prompt, Windows PowerShell, PowerShell 7, and also Windows Subsystem for Linux shells (I am using, for example, Ubuntu with the Windows Subsystem for Linux 2 (WSL 2)).

Scott Hanselman wrote a great blog post on how you can add tabs to open an SSH connection directly, so why not do the same thing with PowerShell? In my example, I will add a tab in Windows Terminal, which opens up a PowerShell remoting session (using WS-Management WSMan) to an Azure virtual machine (VM). However, this would work with every other machine which you can access using PowerShell Remoting.

Add a PowerShell Remote Session in Windows Terminal Tab

To get started, we need to open up the settings of the Windows Terminal. This will open up a settings.json file, which you can edit in your favorite editor, for example, Visual Studio Code. To add new “menu items,” you will need to add a profile to the profiles array in the JSON file. In my case, I will add two to different menu items, once I am going to do a PowerShell remoting session to an Azure VM using Windows PowerShell and in the other, I am going to use PowerShell 7.

Windows Terminal Settings profiles

Windows Terminal Settings profiles

You can see here the following to profile entries:

Remote Session using Windows PowerShell 5.1

{
"name":  "PS Thomas AzureVM",
"tabTitle": "PS Thomas Maurer AzureVM",
"commandline": "powershell.exe -NoProfile -NoExit -Command Enter-PSSession -ComputerName azurevmps.westeurope.cloudapp.azure.com -Credential thomas",
"icon": "C:/Users/thoma/Downloads/AzureVMIcon32.png"
},

Remote Session using PowerShell 7

{
"name":  "PS Thomas AzureVM",
"tabTitle": "PS Thomas Maurer AzureVM",
"commandline": "pwsh.exe -NoProfile -NoExit -Command Enter-PSSession -ComputerName azurevmps.westeurope.cloudapp.azure.com -Credential thomas",
"icon": "C:/Users/thoma/Downloads/AzureVMIcon32.png"
},

As you can see, we define the profile name and the tab title in for the Windows Terminal entry. We have the command line command here, which starts the PowerShell remoting session. The command opens a PowerShell session to a specific computer or server using the ComputerName parameter and the Credential parameter for the credentials. In my case, I am connecting to an Azure VM with the name azurevmps.westeurope.cloudapp.azure.com (could also be an IP address) and the username Thomas. The last thing I add is a small icon (32×32 pixel) since I am connecting to an Azure VM, I took the Azure VM icon.

In this scenario, I am using PowerShell Remoting over HTTP, you can use the same thing for your connections using PowerShell Remoting over HTTPS or even PowerShell Remoting over SSH which are way more secure, and should be used for your connections. If you are looking to create the same Windows Terminal menu entry using a simple SSH connection, check out my blog post here.

Now your Windows Terminal drop-down menu will look like this:

Add a PowerShell Remote Session in Windows Terminal Tab

Add a PowerShell Remote Session in Windows Terminal Tab

By selecting one of these profiles, you will automatically open a PowerShell remoting session to a specific computer or server in Windows Terminal.

Windows Terminal - Azure virtual machine VM PS Remote Session

Windows Terminal – Azure virtual machine VM PS Remote Session

I hope this gives you an idea of how you can add a PowerShell remote session in Windows Terminal menu. If you want to know more about the Windows Terminal, check out the following blog, and if you have any questions, please feel free to leave a comment.

If you want to know more about what’s new in PowerShell 7, or if you want to learn more about how to customize the Windows Terminal, check out my blog.



Run Azure PowerShell in a Docker Container Image

Run Azure PowerShell in a Docker Container

Yesterday, the Azure PowerShell team announced the Azure PowerShell Docker Container images. In this post, I want to quickly highlight that announcement and show you how you can download, pull, and run Azure PowerShell in a Docker container image from Microsoft.

But first, let’s talk about why you would want to run an Azure PowerShell in a Docker container. Azure is continuously evolving, and the Azure PowerShell team releases a new version of the Azure PowerShell modules every three weeks. This makes it challenging to maintain a production or development environment up to date and ensuring the smooth execution of scripts. With the Azure PowerShell docker container image, you can quickly run scripts against a specific version of Azure PowerShell.

The team highlights the current scenarios:

  • On the same machine, you can run scripts that are using a different version of Az with no conflicts.
  • You can test a script against a different version of Az with no risks.
  • You can run the latest container image interactively.


Home Office Setup 2020

My Home Office Setup 2020 – How does yours look like?

A couple of days ago, Microsoft and other companies recommended that people work from home (if they can) due to the Corona disease (COVID-19). Since I am part of a remote team, I work mostly from home when I am not traveling, and so let me share my home office setup 2020 with you. I did share my home office setup already in 2018 after we just moved. Since then, I have upgraded my home office with a couple of new things, which I believe make working from home even more productive and enjoyable.

This is it, this is my Home Office Setup in 2020

Here is a quick view at my desk setup:



PowerShell ISE Mode in Visual Studio Code

How to use PowerShell ISE Mode in Visual Studio Code

If you are writing PowerShell code, you might have realized that there weren’t really improvements to the PowerShell Integrated Scripting Environment (PowerShell ISE) in the last couple of releases. With PowerShell becoming more popular on cross-platform systems, Visual Studio Code (VS Code) becomes the editor of choice. However, by default Visual Studio Code has a different behavior than the PowerShell ISE. To make it even easier, the latest PowerShell extension for Visual Studio Code, now includes PowerShell ISE Mode. PowerShell ISE Mode in Visual Studio Code, helps you to replicate and enable the settings from the following Microsoft Docs article: How to replicate the ISE experience in Visual Studio Code.

The ISE was first introduced with Windows PowerShell V2 and was re-designed with PowerShell V3. The ISE is supported in all supported versions of Windows PowerShell up to and including Windows PowerShell V5.1.

The PowerShell ISE is no longer in active feature development. As a shipping component of Windows, it continues to be officially supported for security and high-priority servicing fixes. We currently have no plans to remove the ISE from Windows.

There is no support for the ISE in PowerShell v6 and beyond.



What's new in PowerShell 7

What’s new in PowerShell 7 – Check it out!

As you know, the PowerShell team just released the new PowerShell version called PowerShell 7. PowerShell 7 will brings a couple of new features and enhancements not only for users who used PowerShell Core 6 but also for people who are currently using Windows PowerShell 5.0. I want to quickly give you an overview of what’s new in PowerShell 7.

New feature enhancements – What’s new in PowerShell 7

There are many enhancements in PowerShell 7 to make it the best PowerShell version yet. It is almost impossible to list all of them in one single blog post, so I will focus on the once, which are the most important once for me.

Out-GridView, -ShowWindow and other GUI cmdlets are back on Windows

With .NET Core 3 brining back WPF support on Windows, the PowerShell team was able to bring back some of the popular graphical tools and cmdlets like Out-Gridview, Show-Command, and the Get-Help -ShowWindow.

Show-Command PowerShell 7

Show-Command PowerShell 7

ForEach-Object -Parallel

Since I started using PowerShell and get into working with objects, ForEach-Object was one of the most critical cmdlets. By adding the -Parallel parameter to the ForEach-Object cmdlet, you can execute a scriptblock in parallel, similar to the option we had with PSWorkflow. With that performance can get so much better if you are working with a broad set of objects. You can also optionally set the maximum threads, which will be used in parallel (the default thread count is set to 5) with the -ThrottleLimit parameter.