Last updated by at .

  • What's new in Hyper-V 2016
  • Microsoft Azure

Tag: PowerShell

Switch Windows Container to Hyper-V Container

Switch a Windows Server Container to a Hyper-V Container

With Technical Preview 4 of Windows Server 2016 made the new Hyper-V Containers available. With that you can now use Windows Server Container and Hyper-V Container. To run Hyper-V Containers you have to make sure, you have Hyper-V Nested Virtualization active for your Container Host VM.

If you create a new Container it will create a Windows Server Container by default, if you want to create a Hyper-V container you have to switch the RuntimeType to Hyper-V.

With the following command you can see which RuntimeType the Container has:

To change the runtime Type to Hyper-V Container you can use the following command:

So switch it back to a Windows Server Container you can use the following command:

 



PowerShell New-TemporaryFile

Create a tempfile with PowerShell

When I was using PowerShell in the early stages it was limited in some features, now with PowerShell version 5 Microsoft added some great new features to it. This time it’s about creating a tempfile. I already wrote a blog post in 2011 how you can create a tempfile in older version of PowerShell using .NET:

With PowerShell 5 you got a native cmdlet for this:



Azure Automation PowerShell ISE Add-on

Azure Automation PowerShell ISE add-on

Microsofts Joe Levy (Program Manager, Azure Automation) just announced in the blog post a new PowerShell ISE add-on for Azure Automation: Announcing the Azure Automation PowerShell ISE add-on. the Azure Automation PowerShell ISE add-on helps you if you are writing PowerShell runbooks for Azure Automation:

In Azure Automation, runbook authoring is typically done in the Azure portal, using our browser-based experience. However, in experimenting with ways to improve our runbook authoring process, we developed a new, open-source tool for runbook authoring – the (take a deep breath) Azure Automation PowerShell ISE add-on!

This project has been in the works for a while and is already used by many of our customers. Now we think it’s finally ready for more exposure and usage. We built this experience because we observed two things:

Our customers heavily use the PowerShell ISE when writing PowerShell
They even use the PowerShell ISE when writing runbooks, copy/pasting back and forth with the portal or importing/exporting with the PowerShell cmdlets
So we thought, why not create an Azure Automation experience that builds on top of this powerful tool? If you’re interested in speeding up your runbook authoring process using tools you’re already familiar with, we hope you’ll give the Azure Automation PowerShell ISE add-on a try!

Installation is very easy, you can get the Azure Automation PowerShell ISE add-on from the PowerShell Gallery:

Install the PowerShell Add-on:

If you want the PowerShell ISE to always automatically load the add-on:

If you just want to load the add-on if you need it run:

 

For more information check out Joe Levy blog post on the Azure blog: Announcing the Azure Automation PowerShell ISE add-on



PowerShell Get-Clipboard

Get and Set Clipboard using PowerShell

PowerShell was always a mighty tool to automate stuff, hut with the first versions we were limited in some functionally. With the release of version 3 and 4 PowerShell got even more powerful. With the latest PowerShell version 5, which is included in Windows Server 2016 and Windows 10 and also can be downloaded for older versions of Windows, Microsoft added some cool new functionality. The first thing I am writing about is the Set-Clipboard and Get-Clipboard cmdlets. The cmdlets allow you to get access to the clipboard of your Windows machine.

For example if you use CTRL + C or Copy the files from explorer:

Get-Clipboard File Explorer

You can use this cmdlet:

PowerShell Get-Clipboard

This also works of course with other file types:

PowerShell Get-Clipboard Image

Great new addition to PowerShell!



Hyper-V VM Switch

Change Hyper-V VM Switch of Virtual Machines using PowerShell

This is one of the first post of a short blog series with some simple PowerShell scripts and oneliners for Hyper-V. One this is how you can connect a Virtual Network Adapter of a Hyper-V Virtual Machine to another Virtual Switch.

This is very simple, with this command you can see all the Network Adapters of the Virtual Machine and to which Switch they are connected:

With this command you can connect it to another Switch:

Now of course you can also do this for all Virtual Machines running on a Hyper-V host:



Webinar PowerShell Scripting and Automation for Hyper-V

Recording: Scripting & Automation in Hyper-V without SCVMM now available

Last week I had the chance to do a Webinar together with Altaro about Scripting & Automation in Hyper-V without SCVMM. Now you can watch the recording from this online webinar.

System Center Virtual Machine Manager (SCVMM) provides some great automation benefits for those organizations that can afford the hefty price tag. However, if SCVMM isn’t a cost effective solution for your business, what are you to do? While VMM certainly makes automation much easier, you can achieve a good level of automation with PowerShell and the applicable PowerShell modules for Hyper-V, clustering, storage, and more.

Are you looking to get grips with automation and scripting?

Join Thomas Maurer, Microsoft Datacenter and Cloud Management MVP, who will use this webinar to show you how to achieve automation in your Hyper-V environments, even if you don’t have SCVMM.

Remember, any task you have to do more than once, should be automated. Bring some sanity to your virtual environment by adding some scripting and automation know-how to your toolbox.

 



Best of Windows Server 2016 Webinar

Webinar: Best of Windows Server 2016 – The new Foundation of Windows

Together with Veeam I am proud to present in two webinars about the new features in Windows Server 2016. The title of the webinar will be Best of Windows Server 2016 – The new Foundation of Windows and will cover the greatest new features of Windows Server 2016.

Join Veeam for a webinar on the Best of Windows Server 2016 — The New Foundation of Windows. You’ll be one of the first to know about new, exciting improvements that are coming in Windows Server 2016 and how they’ll improve your day-to-day job. In this hour-long webinar, Thomas Maurer (Microsoft MVP) will guide you through the highly anticipated innovations including:

Attend this FREE Webinar to learn about the latest and greatest features of Windows Server 2016. You have to options one for North America and one for EMEA.

December 15 Tuesday NA 1pm ET, EMEA 2pm CET

Best of Windows Server 2016 – The new Foundation of Windows

Join Veeam for a free webinar on the Best of Windows Server 2016 — The New Foundation of Windows. You’ll be one of the first to know about new, exciting improvements that are coming in Windows Server 2016 and how they’ll improve your day-to-day job.

 

Thomas Maurer, one of the first Veeam Vanguards, is a cloud architect at a Swiss consulting and engineering company called itnetX AG. Thomas focuses on Microsoft Technologies, specifically Microsoft Cloud Solutions based Microsoft System Center, Microsoft Virtualization and Microsoft Azure. Thomas was awarded the Microsoft MVP (Most Valuable Professional) Award for his expertise in virtual machines (VMs) in 2012. He works closely with Microsoft and their partners to promote Microsoft technology at technical events.