Category: PowerShell

Updated PowerShellGet and PackageManagment

Update PowerShellGet and PackageManagement

Since I am just setting up a new work machine, I wanted to share some information how you can update PowerShellGet and PackageManagement to the latest version. This will give you the usual bug fixes and performance enhancements. Since you don’t get the latest version in Windows PowerShell nor PowerShell Core, you will need to update it manually.

PowerShellGet is a PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts. For example you use PowerShellGet to install the Azure PowerShell module, or other modules.

PowerShellGet module is also integrated with the PackageManagement module as a provider, users can also use the PowerShell PackageManagement cmdlets for discovering, installing and updating the PowerShell artifacts like Modules and Scripts.

(source: GitHub)

How to update PowerShellGet and PackageManagement

Updating to the latest version of PowerShellGet and the PackageManagement module is simple. Since both modules are part of the PowerShell Gallery, you can update them using a couple of simple commands.

You can find both modules in the PowerShell Gallery:

First lets check which versions of the modules you have available. If you use Update-Module, it will automatically load PowerShellGet and PackageManagement and list them as loaded PowerShell modules. Of course you can also use Get-Module -ListAvailable.

PowerShell Modules PowerShellGet and PackageManagement

As you can see, In my default installation, I got PowerShellGet version 1.6.7 and PackageManagement 1.1.7.2. If you have a look at PSGallery, you will see that these are pretty old versions and that there are newer available.

To get the latest version from PowerShell Gallery, you should first install the latest Nuget provider. You will need to run PowerShell as an Administrator for all  the following commands.

If you run PowerShell 5.0 or newer, you can install the latest PowerShellGet using the following command. PowerShell 5.0 is included in Windows 10, Windows Server 2016, Windows Server 2019, any system with WMF 5.0 and 5.1 or a system running PowerShell 6.

Two quick tips, first of, you will need to set the execution policy to RemoteSigned to allow the new module to run. Secondly in some cases you will need to use the -AllowClobber parameter to install the updated version of the module.

You can then use Update-Module to get newer versions:

Updated PowerShellGet and PackageManagment

After that you will see the latest versions of PowerShellGet and PackageMangement available

If you run older versions of PowerShell you can check out the full documention on the PowerShell Docs. I hope this blog post helps you to update PowerShellGet and benefit from the latest versions. If you have any questions, please let me know in the comments.



Azure IaaS Webinar

Join me for a Azure IaaS Masterclass Webinar!

This Wednesday, Altaro have invited me to give a webinar on Infrastructure as a Service with Microsoft Azure and you’re invited – it’s free to join!

Implementing Infrastructure as a Service is a great way of streamlining and optimizing your IT environment by utilizing virtualized resources from the cloud to complement your existing on-site infrastructure. It enables a flexible combination of the traditional on-premises data center alongside the benefits of cloud-based subscription services. If you’re not making use of this model, there’s no better opportunity to learn what it can do for you than in this upcoming webinar.

I’ll be joined by me good friend from Altaro, Technical Evangelist and Microsoft MVP Andy Syrewicze. I’ve done a few webinars with Andy over the years and it’s always a fun experience to work with him. We have also received great feedback from attendees saying they learnt a lot and enjoy the format in which we present.

The webinar will be primarily focused on showing how Azure IaaS solves real use cases by going through the scenarios live on air. Three use cases have been outlined already, however, the webinar format encourages those attending to suggest their own use cases when signing up and the two most popular suggestions will be added to the list. To submit your own use case request, simply fill out the suggestion box in the sign up form when you register!

Like all Altaro webinars, this will be presented live twice on the day (Wednesday 13th February). So if you can’t make the earlier session (2pm CET / 8am EST / 5am PST), just sign up for the later one instead (7pm CET / 1pm EST / 10am PST) – or vice versa. Both sessions cover the same content but having two live sessions gives more people the opportunity to ask their questions live on air and get instant feedback from us.

Save your seat for the webinar and learn more about Azure IaaS

Altaro Webinar Azure IaaS VMs



Hyper-V VM Configuration Version

Hyper-V VM configuration version supported features

A couple of months ago, I wrote an article about the new Microsoft Hyper-V UEFI in Windows Server 2019 and Windows 10 virtual machines. With that version Microsoft also released a new Hyper-V VM configuration version 9.0. This is not unusual, the Hyper-V teams usually bumps up the version number from release to release, since new Hyper-V features are introduced. In the comments, the question came up, what is new in this version of the Hyper-V VM configuration, Since the version was still a preview release of Windows Server and Windows 10, Microsoft didn’t share the full list of features per configuration version. However, now the documentation is ready and you can find the documentation here.

Supported features

The following table shows the minimum virtual machine configuration version required to use some Hyper-V features.

Windows ServerWindows 10VersionFeature
Windows Server 2016 Technical Preview 3Windows 10 15076.2Hot Add/Remove Memory
Windows Server 2016 Technical Preview 3Windows 10 15076.2Secure Boot for Linux VMs
Windows Server 2016 Technical Preview 3Windows 10 15076.2Production Checkpoints
Windows Server 2016 Technical Preview 3Windows 10 15076.2PowerShell Direct
Windows Server 2016 Technical Preview 3Windows 10 15076.2Virtual Machine Grouping
Windows Server 2016 Technical Preview 4 Windows 10 15117.0Virtual Trusted Platform Module (vTPM)
Windows Server 2016 Technical Preview 57.1Virtual machine multi queues (VMMQ)
Windows Server 2016Windows 10 Anniversary Update8.0XSAVE support
Windows Server 2016Windows 10 Anniversary Update8.0Key storage drive
Windows Server 2016Windows 10 Anniversary Update8.0Guest virtualization-based security support (VBS)
Windows Server 2016Windows 10 Anniversary Update8.0Nested virtualization
Windows Server 2016Windows 10 Anniversary Update8.0Virtual processor count
Windows Server 2016Windows 10 Anniversary Update8.0Large memory VMs
Windows Server 1803Windows 10 April 2018 Update8.3Increase the default maximum number for virtual devices to 64 per device (e.g. networking and assigned devices)
Windows Server 2019/1809Windows 10 October 2018 Update9.0Allow additional processor features for Perfmon
Windows Server 2019/1809Windows 10 October 2018 Update9.0Automatically expose simultaneous multithreading configuration for VMs running on hosts using the Core Scheduler
Windows Server 2019/1809Windows 10 October 2018 Update9.0Hibernation support

Source: Microsoft Docs (Thanks to Rene Moergeli for the link)

How to list the supported VM configuration versions

You can list all supported VM configuration versions on your Hyper-V host using the Get-VMHostSupportedVersion cmdlet.

Get-VM Hyper-V VM Configuration Version

If you want to see the version of a Hyper-V virtual machine, you can use Hyper-V Manager or the following PowerShell command:

Full list of Hyper-V VM versions

Here you have a full list of VM configuration versions of Hyper-V VMs together with the operating system.

Windows ClientWindows ServerVersion
Windows Server 20081.0
Windows Server 2008 SP12.0
Windows Server 2008 R23.0
Windows 8Windows Server 20124.0
Windows 8.1Windows Server 2012 R25.0
Windows 10 1507Windows Server 2016 Technical Preview 36.2
Windows 10 1511Windows Server 2016 Technical Preview 47.0
Windows Server 2016 Technical Preview 57.1
Windows 10 Anniversary UpdateWindows Server 20168.0
Windows 10 Creators Update8.1
Windows 10 Fall Creators UpdateWindows Server 17098.2
Windows 10 April 2018 UpdateWindows Server 18038.3
Windows 10 October 2018 UpdateWindows Server 2019 / 18099.0
Windows 10 April 2019 UpdateWindows Server 19039.1
PrereleasePrerelease254.0
ExperimentalExperimental255.0

How to upgrade Hyper-V VM configuration version

Hyper-V vNext Update VM Configuration Version

Upgrading the Hyper-V VM version is pretty straight forward. If the VM is running on a host supporting a newer version of Hyper-V VMs, you can right click the virtual machine in the Hyper-V Manager and click on upgrade or you can run the Update-VMVersion PowerShell cmdlet.

I hope this blog was help full for understanding Hyper-V VM versions, let me know if you have any questions in the comments!



Mastering Azure with Cloud Shell

Mastering Azure with Cloud Shell

There are multiple ways to interact and manage resources in Microsoft Azure. You can use the Azure Portal or command line tools like the Azure PowerShell module or the Azure CLI, which you can install on your local machine. However, to set up a cloud management workstation for administrators and developers can be quite a lot of work. Especially if you have multiple machines, keeping consistency between these machines can be challenging. Another challenge is keeping the environment secure and all the tools up to date. This any many more things are addressed by the Cloud Shell.

Cloud Shell is not brand new, Microsoft announced Cloud Shell at Build 2017. This blog post is about how you can master Azure with Cloud Shell and to give you an overview about the possibilities of Cloud Shell.

What is Cloud Shell

Cloud Shell Azure Portal

Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself. Azure Cloud Shell is assigned per unique user account and automatically authenticated with each session. This makes it a private and secure environment.

You get a modern web-based command line experience which can be accessed from several end points like the Azure Portal, shell.azure.com and the Azure mobile app, Visual Studio Code or directly in the Azure docs.

In the backend Azure uses containers and automatically attaches an Azure File Share to the container. You can store the data on it, so your data is persistent. This persist your data across different Cloud Shell sessions.

Cloud Shell Bash and PowerShell

You can choose your preferred shell experience. Cloud Shell supports Bash and PowerShell and included your favorite third party tools and common tools and languages. If something like a module is missing, you can simply add it.



Extended Security Updates for SQL Server and Windows Server 2008 and 2008 R2 on Azure Stack

Extended Security Updates for SQL Server and Windows Server 2008 and 2008 R2 on Azure Stack

SQL Server and Windows Server 2008 and 2008 R2 will both be out of extended support within the  next 12 months (detailed dates below). This means if you have these versions, you’ll need to migrate to newer versions of SQL Server or Windows Server or buy Extended Support soon to maintain support and receive security updates and fixes. Buying Extended Support is not cheap. Customers with active Software Assurance or subscription licenses can purchase Extended Security Updates annually for 75 percent of the full license cost of the latest version of SQL Server or Windows Server. A lot of customer should start migrating to newer versions of these products to avoid these extra costs.

Extended Support dates

  • Extended Support for SQL Server 2008 and 2008 R2 will end on July 9, 2019.
  • Extended Support for Windows Server 2008 and 2008 R2 will end on January 14, 2020.

However, in mid-2018 Microsoft announced a new option for SQL Server 2008 and Windows Server 2008 End of Support. Customers running 2008 or 2008 R2 versions of SQL Server and Windows Server in Azure virtual machines will get Extended Security Updates for free. This will give customers some extra time to migrate to newer versions of SQL Server and Windows Server. Or even better, to Azure PaaS and serverless computing like Azure Functions.

The great thing about this, is that you can also combine this with your Azure Hybrid benefits, to use your SQL Server and Windows Server on Azure with your on-premise licenses.

Extended Security Updates on Azure Stack

If you are thinking to migrate to the cloud, this new option will bring down costs for you. However, not everyone is fully ready to move all their servers to the public cloud. You might still need or want to run some servers on-premise in your datacenter. This will leave you with buying Extended Support or what a lot of people don’t know, you can also run your SQL Server and Windows Server 2008 and 2008 R2 on Azure Stack and get Extended Security Updates for free, since it is basically Azure!

This is great, especially since Azure Stack also comes with great IaaS capabilities. And if you are thinking about using Azure in the mid-term, Azure Stack provides you with Azure capabilities, but still allows you to stay in your own datacenter.



Azure Stack Tenant Portal

Considerations for deploying apps and services on Azure Stack

I work with a couple of customers on different Azure Stack projects. One of the main topics that always comes up, is what are the differences between Azure and Azure Stack when deploying applications and services. Obviously there are the high level differences, which I have written about it here: Microsoft Azure Stack – Azure Extension in your Datacenter. However, there are also small differences in features and services between Azure and Azure Stack. These differences can block customers form deploying and automating workloads. I tried to summarize the most common differences and considerations you should know, in a single blog post.

High-level differences between Azure and Azure Stack

Some of the high-level differences between the to platforms are:

  • An Azure Stack does not have the same SLA and physical security in place, since the Azure Stack does not run in a Microsoft operated location.
  • Azure Stack provides only a subset of the Azure services and features.
  • Azure Stack is not operated by Microsoft. Azure Stack backend is operated by the operators in your company or by a service provider.
  • The Azure Stack operator, which can be your company or a service provider, chooses which services, features and marketplace items he wants to make available on Azure Stack.
  • Azure Stack comes with its own portal. It has the same look and feel, but it will be another URL and endpoints for the portal as well as for the APIs.
  • Azure Stack will have different PowerShell and API versions available. If you are building a hybrid cloud app, which should work on Azure and Azure Stack, make sure you are using the versions supported by Azure Stack.

Considerations and differences between Azure and Azure Stack

Obviously, there is much more to this. I put a list of links together, where you can find the differences between Azure and Azure Stack and more considerations you should think of when deploying on Azure Stack.

Setup an Azure Stack operator and developer environment

Install Azure Stack PowerShell

To connect to Azure Stack using PowerShell, Visual Studio, the Azure CLI or other Azure Stack tooling, you have to setup a few things. I recommend that you read my blog post about how to setup an Azure Stack operator and developer environment. This is not only helpful for operators, but also for people who want to deploy and develop solutions on Azure Stack.

Check API versions available on Azure Stack

Azure Stack API Verions PowerShell

If you are an Azure Stack tenant and you want to check which API versions are available on your Azure Stack, you can run the following PowerShell command against Azure Stack. This does not need any administrator rights, you will just need a tenant account on Azure Stack to access it. If your Azure Stack is running at a service provider, it is very likely that you won’t have access to the Administrator portal to check the version.

Check Azure Stack version release notes

Azure Stack Version Release Notes

Another good thing to check if you are running in any issues deploying applications or services, is to check the Azure Stack version release notes. They document very well the new features added, fixed as well as known issues with that release.

You can find the links to the latest Azure Stack release notes here. I also recommend that you read my article about Updating Azure Stack.

I hope this gives you a quick overview and help you to successfully deploy applications and services on Azure Stack. You can find most of this information on the documentation site, but I decided to consolidate this information in one post.



WLinux WSL Setup Wizard for Windows 10

WLinux – The best WSL for Windows 10

A couple of Windows 10 releases back, Microsoft delivered the Windows Subsystem for Linux. The Windows Subsystem for Linux allows you to run Linux distros, like Ubuntu, Debian, Suse and others, on Windows 10. Around the Microsoft Ignite 2018 timeframe another distro was released to the Windows Store called WLinux. WLinux is a Linux environment for Windows 10 built on work by Microsoft Research and the Debian project. WLinux is a custom Linux distro built from Debian specifically for use on the WSL. While other distros are available for WSL, WLinux is the first optimized for use by users of WSL for WSL. It helps developer run Linux tooling on Windows and integrates into perfectly into Windows.

WLinux Setup

WLinux WSL Setup Wizard for Windows 10

WLinux comes with a custom setup, to prepare your environment in a very simple and easy wizard. It lets you setup some predefined software and settings and configure integration into Windows.

WLinux WSL Docker Bridge to Windows

WLinux Docker Bridge

If you want to run Docker in the Windows Subsystem for Linux, you can bring the Docker Client to the Windows Docker Engine. This allows you to run Docker directly from WSL and from PowerShell at the same time.

Microsoft Tooling

WLinux Installing Azure CLI

Of course WLinux brings the usual Linux development tools and easy setup for Ruby, NodeJS, Go, Java, Python, editors like emacs and even different shells. You can also easily add Microsoft tooling by adding Azure CLI, PowerShell Core and even Visual Studio Code.

Windows Explorer Integration and WSL Utilities (wslu)

It easily lets you to setup Windows Explorer integration and brings wslu, a collection of utilities for WSL, preinstalled. Wslu bringt the following features to the WSL

  • wslusc This is a WSL shortcut creator to create a shortcut on your Windows 10 Desktop.
  • wslsys This is a WSL system information printer to print out some basic system information.
  • wslfetch This is a WSL Screenshoot Information Tool to print information in an elegant way.
  • wslupath This is a WSL Windows path Converter that can convert Windows path to other styles of path.
  • wslview This is a fake WSL browser that can help you open link in default Windows browser.

WSLfetch

If you want to know more about WLinux, check out the website Whitewater Foundry.

Or download WLinux from the Microsoft Store.

You can also contribute on the project on GitHub.