Tag: PowerShell

Last updated by at .

Azure Stack PowerShell Docker Container

Run Azure Stack PowerShell and Azure Stack Tools in a Docker Container

The Azure Stack Tools is a set of scripts and tools to work with Azure Stack and Azure. If you want to run the Azure Stack Tools you will need to install the Azure Stack compatible Azure PowerShell module. To install that that can be some work and it does not allow to run the side by side today with the latest Azure PowerShell Module. For that I have a simple solution. I created two Docker Containers with preinstalled Azure Stack PowerShell and one with Azure Stack PowerShell and the Azure Stack Tools together.

AzureStack-Tools is a GitHub repository that hosts PowerShell modules for managing and deploying resources to Azure Stack. If you are planning to establish VPN connectivity, you can download these PowerShell modules to the Azure Stack Development Kit, or to a Windows-based external client

Azure Stack PowerShell Docker Container

Azure Stack PowerShell Docker Container

This container contains the Azure Stack PowerShell. To run Azure Stack PowerShell in a Docker Container, just run the following command on your server or PC with Docker installed.

Azure Stack Tools Docker Container

Azure Stack Tools Docker Container

This container contains the Azure Stack PowerShell as well as the Azure Stack Tools. To run Azure Stack Tools in a Docker Container, just run the following command on your server or pc with Docker installed.

Both Images are based on Windows Server Core and depending on the microsoft/windowsservercore Docker images.

This should help you to quickly spin up new Azure Stack Operator Workstations. And it should help you to work and interact with Azure Stack.

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.


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.


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!


Announcing the itnetX PowerShell DSC Manager

Less than a year ago I worked with a couple of enterprise customers and had some interesting talks about configuration management in a modern Windows Server based datacenter where PowerShell DSC is the obvious. However the lack of graphic on premise management tools was a huge challenge for a lot of companies. While the concept of writing your configurations may not seem complicated, appropriately distributing them to machines and being able to report on the status is something that is very challenging to do on-prem. That’s where the idea was born to bring a graphical user experience for PowerShell DSC.


Within itnetX we have done a couple of projects for service providers and other customers to help them automate deployments but also do configuration management, which provides us with the technical knowledge and experience what customers truly need.

Today I am happy to announce the itnetX DSC Manager.

Our customers love DSC to manage the configuration of their servers. However, they complain that maintaining DSC and getting insights is very cumbersome due to the lack of a user interface.

With DSC Manager, we respond to our customers with an easy to use and fresh user experience for having DSC under total control.

Dieter Gasser, itnetX Head of Product Management

itnetX DSC Manager


The itnetX DSC Manager provides a single pane of glass for all your clients, configurations and modules, regardless of where they are in your datacenter. itnetX DSC Manager allows you to implement configuration management the way DSC was intended from the beginning. Allowing you to effectively mitigate configuration drift, reconfigure servers with a few clicks and report on the configuration of any one server or group of servers

Key Benefits

  • Easy to read reports & dashboards
  • Remote configuration of LCM
  • Graphically view and build configurations
  • Manage large estates of PullServers
  • Build into existing automation with REST
  • Audit changes for compliance


  • HTML reports and dashboards
  • Assign Named and Partial configurations
  • Configure LCM remotely to control for example reboot behavior
  • Visually view and build configurations
  • Manage agents from multiple PullServers
  • Manage Module repository
  • Automate via REST

Get Free Trial

DSC Manager is delivered as a prepackaged web application. The installation is simple and the clients can be installed and up and running within minutes. You can use DSC Manager for free to manage up to 5 clients. For managing more clients, you will require a license.

Big thanks goes to itnetX and the team behind the DSC Manager. itnetX also has a process in place which allows employees to build and work on their own ideas and bring them to market. Together with DSC experts like Ryan Bartram itnetX started that journey and we finally have something to celebrate.

Btw: If you need some help for a faster setup, check out: the Quick itnetX DSC Manager Installer script, which removes a couple of manual tasks.


Azure Stack Tools

Setup an Azure Stack Cloud Operator and Developer Workstation Environment

If you are responsable to manage and operate Azure Stack, you will need to enable a couple of tools to manage Azure Stack. This post should give you a summary of what you should do to setup your Azure Stack Operator and Developer workstation environment.

Operating System

Azure Stack Windows Admin Workstation

First of all you should setup a clean base system. I usually use the latest version of Windows 10, right now the latest Windows 10 version is the Fall Creators Update which give you some great features like the OpenSSH client or the Windows Subsystem for Linux build in, or I use Winodws Sevrer 2016 with Desktop Expierence. Make sure you install all the latest updates for Microsoft Update.

Install Visual Studio Code

PowerShell for Visual Studio Code

Visual Studio Code is a new, free, lightweight cross-platform code editor for building modern web and cloud applications on Mac OS X, Linux and Windows. It is perfect for editing JSON files and even writing some code. And it has a built-in Terminal so you don’t have to switch between different windows.

I recommend you install the following Extensions:

Install SSH Client or Windows Subsystem for Linux (WSL)

OpenSSH Windows 10

To manage Linux Virtual Machines running on Azure Stack or if you need to manage the hardware switches in Azure Stack or your border switches where Azure Stack is connected, SSH is the way to access it. Windows 10 now comes with several builtin options like the OpenSSH Client which you can install as addtional feature or for example the Windows Subsystem for Linux (WSL) which allows you to run several linux tools on Windows directly. If you are using another version of Winodws, the thrid party application PuTTY is your friend.

You can also using PowerShell to install it:

Install Azure Stack PowerShell

Install Azure Stack PowerShell

Azure Stack compatible Azure PowerShell modules are required to work with Azure Stack. PowerShell commands for Azure Stack are installed through the PowerShell gallery, you can run the following commands to install it: (Make sure there are no other Azure PowerShell Modules installed, if there are, the commands will remove them). If you also install Visual Studio, install Visual Studio first before you install the Azure Stack PowerShell.

If you need to install it on a machine which does not have access to the internet. check outthe offical Microsoft page: Install PowerShell for Azure Stack

Install Azure Stack tools

Azure Stack Tools

AzureStack-Tools is a GitHub repository that hosts PowerShell modules that you can use to manage and deploy resources to Azure Stack. This brings you several functionalities for Azure Stack management:

  • Deployment of Azure Stack – Helps prepare for Azure Stack deployment.
  • Resource Manager policy for Azure Stack – Constrains Azure subscription to the capabilities available in the Azure Stack.
  • Connecting to Azure Stack – Connect to an Azure Stack instance from your personal computer/laptop.
  • Setting up Identity for Azure Stack – Create and manage identity related objects and configurations for Azure Stack
  • Azure Stack Service Administration – Manage plans and subscriptions in Azure Stack.
  • Azure Stack Compute Administration – Manage compute (VM) service in Azure Stack.
  • AzureRM Template validator – Validate Azure ARM Template Capabilities
  • Azure Stack Infrastructure Administration – Manage Azure Stack Infrastructure

You can get the Azure Stack tools from GitHub:

You can directly open that folder in Visual Studio Code:

Configure Azure Stack PowerShell environment

As an Azure Stack user, you can configure your Azure Stack PowerShell environment. After you configure, you can use PowerShell to manage Azure Stack resources such as subscribe to offers, create virtual machines, deploy Azure Resource Manager templates, etc.

For an Azure Stack deployment which is using Azure Active Directory (AAD) as an Identity provider, you can use the following commands:

Install and configure CLI for use with Azure Stack

Azure CLI

You can also use the Azure CLI 2.0 to manage Azure Stack.

Install Azure CLI on Windows using MSI

To install the CLI on Windows and use it in the Windows command-line, download and run the Azure CLI Installer (MSI).

Install with apt-get for Bash on Ubuntu on Windows (WSL)

  1. Open the Bash shell.
  2. Modify your sources list.
  3. Run the following sudo commands:
  4. Run the CLI from the command prompt with the az command.

Connect to Azure Stack using the Azure CLI

If you are using Public Certificates for your Azure Stack, this is pretty staight forward, if you are using the Azure Stack Development Kit or an Internal CA, make sure your client trusts the Azure Stack CA root Certificate. You can find more here: Install and configure CLI for use with Azure Stack

Register your Azure Stack environment by running the az cloud register command.

Register as a cloud administrative environement:

  1. To register the cloud administrative environment, use:
  2. Set the active environment by using the following commands.
  3. Update your environment configuration to use the Azure Stack specific API version profile. To update the configuration, run the following command:
  4. Sign in to your Azure Stack environment by using the az login command. You can sign in to the Azure Stack environment either as a user or as a service principal.

Register the user environment, use:

  1. To register the user environment, use:
  2. Set the active environment by using the following commands.
  3. Update your environment configuration to use the Azure Stack specific API version profile. To update the configuration, run the following command:
  4. Sign in to your Azure Stack environment by using the az login command. You can sign in to the Azure Stack environment either as a user or as a service principal.

Install the Microsoft Azure Storage Explorer

Azure Stack Azure Storage Explorer

To access and manage Azure Stack Storage Accounts you can also use the Microsoft Azure Storage Explorer tool. Microsoft Azure Storage Explorer (Preview) is a standalone app from Microsoft that allows you to easily work with Azure Storage data on Windows, macOS and Linux.

If you are running the Azure Stack Development Kit, you should again have a look how you get the certificates implace, you can find that here: Connect Storage Explorer to an Azure Stack subscription

  1. Install the Microsoft Azure Storage Explorer
  2. After Storage Explorer  restarts, select the Edit menu, and then ensure that Target Azure Stack is selected. If it is not selected, select it, and then restart Storage Explorer for the change to take effect. This configuration is required for compatibility with your Azure Stack environment.
  3. To connect to the Azure Stack account, select Add an account.
  4. In the Connect to Azure Storage dialog box, under Azure environment, select Use Azure Stack Environment, and then click Next.
  5. To sign in with the Azure Stack account that’s associated with at least one active Azure Stack subscription, fill in the Sign in to Azure Stack Environment dialog box.
    The details for each field are as follows:Environment name: The field can be customized by user.
    ARM resource endpoint: The samples of Azure Resource Manager resource endpoints:For cloud operator:
    For tenant:
    Tenant Id: Optional. The value is given only when the directory must be specified.

This should help you quickly setup an Azure Stack Cloud Operator Workstation. What other tools do you need to manage and operator your Azure Stack? leave a comment.


Speaking at Experts Live Cafe January 2018 Edition in Bern

I am happy to announce and remind you that I will be speaking at the Experts Live Cafe in Bern this Friday. The Experts Live Cafe is a Swiss IT Pro Meetup run by the Microsoft MVPs Stefan Johner and Stefan Roth. Experts Live is a non-profit organization that has a mission to enable sharing of knowledge and experience about Microsoft technologies worldwide. The ExpertsLive Cafes are user group meetups which are designed to bring IT professionals closer together.

I will be covering one of two sessions about this months Experts Live Cafe and talk about Windows Server.

What is next for Windows Server

In Fall 2017 Microsoft has updated Windows Server to the next Semi-Annual Channel release with new features and improvements and Microsoft will now release new SAC and LTSC releases. Join this session for the best of Windows Server, learn how the new Servicing Model of Windows Server works and what does it mean to use SAC or LTSC releases, and what new improvement and features Microsoft offers in the latest releases such as 1709 and 1803. You’ll get an overview about the new, exciting improvements that are in Windows Server and how they’ll improve your day-to-day job.

There should be still some free seats, so hopefully see you there!


Microsoft Edge Windows Defender Application Guard

Enable Windows Defender Application Guard on Windows 10 using PowerShell

A couple of days back I saw a tweet form Stefan Stranger (Consultant at Microsoft) which reminded me of a feature called Windows Defender Application Guard, which is included in Windows 10 Enterprise since the Fall Creators Update (1709). If you have never heard of Application Guard, you might want to check out this blog post: Introducing Windows Defender Application Guard for Microsoft Edge

Basically Windows Defender Application Guard starts Microsoft Edge in a Hyper-V Container and uses Hyper-V isolation. So if a user browses on a malicious site, the site is separate from the host operating system.

Application Guard Hardware Isolation

What is Windows Defender Application Guard and how does it work?
Designed for Windows 10 and Microsoft Edge, Application Guard helps to isolate enterprise-defined untrusted sites, protecting your company while your employees browse the Internet. As an enterprise administrator, you define what is among trusted web sites, cloud resources, and internal networks. Everything not on your list is considered untrusted.

If an employee goes to an untrusted site through either Microsoft Edge or Internet Explorer, Microsoft Edge opens the site in an isolated Hyper-V-enabled container, which is separate from the host operating system. This container isolation means that if the untrusted site turns out to be malicious, the host PC is protected, and the attacker can’t get to your enterprise data. For example, this approach makes the isolated container anonymous, so an attacker can’t get to your employee’s enterprise credentials.

Source: Windows Defender Application Guard overview

Usually Windows Defender Application Guard is configured using a Enterprise devices management tool like System Center Configuration Manager, Microsoft Intune or another third-party tool. But if you want to use this on your standalone Windows 10 PC you can also do this using PowerShell.

The only thing you need to run this is:

  • Windows 10 Enterprise 1709 (Fall Creators Update) or higher
  • A computer which supports Hyper-V
    • A 64-bit computer with minimum 4 cores is required for hypervisor and virtualization-based security (VBS)
    • Extended page tables, also called Second Level Address Translation (SLAT)
    • One of the following virtualization extensions for VBS:
      • Intel VT-x
      • AMD-V
    • Microsoft recommends 8GB RAM for optimal performance
    • 5 GB free space, solid state disk (SSD) recommended
    • Input/Output Memory Management Unit (IOMMU) support is strongly recommended
  •  Microsoft Edge and Internet Explorer

Enable Windows Defender Application Guard using PowerShell

You can simply install Application Guard using the following command:

New Application Guard Windows in Microsoft Edge

This will reboot your computer and after this you will be able to open a new Microsoft Edge windows in Application Guard.

Microsoft Edge Windows Defender Application Guard

This does added some extra security, however it does not really protect against like the Meltdown and Spectre attacks.

Application Guard Virtual Machine Worker Process

If you have a look at the processes running on your computer you can now see that there is a new Virtual Machine Worker Process which is used by the Application Guard.

This is a great example how the Hyper-V isolation can not only be used for Hyper-V Virtual Machines but also other features like Hyper-V Containers or for example on the Xbox One.

PowerShell Core

PowerShell Core 6.0 for Windows, Linux and macOS General Available (GA)

Microsoft yesterday announced the general availability of PowerShell Core 6.0. PowerShell Core 6.0 is a new edition of PowerShell that is cross-platform (Windows, macOS, and Linux), open-source, and built for heterogeneous environments and the hybrid cloud. PowerShell Core uses .NET Core 2.0 as its runtime. PowerShell Core also exposes the API set offered by .NET Core 2.0 to be used in PowerShell cmdlets and scripts.

First and foremost, thank you to all of our amazing community, especially our open-source contributors (the most recent of which you can find on our community dashboard at https://aka.ms/PSGitHubBI) for donating your time and energy to PowerShell Core. Whether you contributed code, tests, documentation, issues, or even just your feedback and opinions, we are extremely grateful for the sweat and tears that you’ve invested in PowerShell. (For those interested in contributing, hop and over to our Contribution Guide on GitHub. You don’t have to be a guru to help out!)

Quote: PowerShell Team Blog: PowerShell Core 6.0: Generally Available (GA) and Supported!

PowerShell Core Installer

You can get PowerShell Core 6.0 here:

PowerShell Core is open source and you can have a look at the code on PowerShell on GitHub