Tag: Modules

Learn about Windows Server Hybrid and Azure IaaS VMs

Learn Windows Server Hybrid and Azure IaaS VMs

A couple of weeks back I promoted a post about how you can learn about Windows Server on Azure and a post on ITOpsTalk for New Microsoft Learn Modules for Azure and Windows Server IT Pros. This week I got another message by colleague Orin Thomas (Cloud Advocate and Author of the Windows Server 2019 Book), that a lot more Microsoft Learn modules have been published, covering Windows Server Hybrid and Windows Server on Azure IaaS VMs (Infrastructure-as-a-Service).

Learn about Windows Server Hybrid and Windows Server Azure IaaS VMs 🎓

Here is a full list of Microsoft Learn modules to learn about Windows Server Hybrid and Windows Server Azure IaaS VMs (virtual machines). This includes many of the Azure Hybrid Cloud services you can use together with Azure, like Azure Arc, Azure File Sync, Azure Site Recovery, and many more. These Microsoft Learn modules also cover a lot of the Azure Management services to manage your Windows Server virtual machines running on Azure, like Azure Monitor, Azure Update Management, networking, and much more.

I hope you enjoy the new Microsoft Learn modules for Windows Server Hybrid and Windows Server on Azure IaaS. If you have any questions feel free to leave a comment below. If you are looking forward to take some exams, also check out my Microsoft exam study guides, for example for:

Happy Learning!



How to create a Powershell v2 Module

Powershell Header

If you need some functions a lot in different scripts you create maybe external function files. This is a good way to clean up your code. To get this functions running in your mainscript.ps1 you can call this other file “dotsourced”:

. C:\PSscript\output\sayhello.ps1

If you have more than one external function you have to call each file:

. C:\PSscript\Modules\Output\sayhello.ps1
. C:\PSscript\Modules\Output\saygoodday.ps1
. C:\PSscript\Modules\Output\saybye.ps1

In Powershell v2 you can create your own modules, which you can call by:

Import-Module C:\PSscript\Modules\Output

Now how can you create this output module?

  • First you create a directory for the all modules, called Modules
  • Secound you create a directory for the Output module, called Output
  • Than copy all of your Powershell Scripts (.ps1 files) in to this folder
  • Now create a file called Output.psm1. Its important that this file has the same name as the folder
  • In this file write the following code (for each file in this folder):
    . ./Modules/Output/sayhello.ps1
    . ./Modules//Output/saygoodday.ps1
    . ./Modules//Output/saybye.ps1

Now you can use the Import-Module to import your own module called output.

There are a lot of other things you can use to make everything a little bit easier, like system variables for the module and script paths.