FIX: Cannot find built-in module that is compatible with the edition

Microsoft.PowerShell.Utility & Microsoft.PowerShell.Management Cannot find the built-in module that is compatible with the edition. Please make sure the PowerShell built-in modules are available. They usually come with the PowerShell package under the $PSHOME module path, and are required for PowerShell to function properly. If you made this error, you screwed up big time.But luckily, it’s … Continue reading FIX: Cannot find built-in module that is compatible with the edition

How to create a maintenance mode in Azure Automation

An emergency button to ensure that your runbooks stop running without disconnecting the schedule in Azure Automation Disclaimer: This post can be seen as satire. There are probably better ways, but because we were so limited with the customer at the time, we opted for a hobby approach: ‘Maintenance mode the creative way‘. What if… … Continue reading How to create a maintenance mode in Azure Automation

FIX: Get-AzContext missing ‘subscription’ Az.Accounts PowerShell

Get-AzContext missing a ‘subscription’ while using Set-AzContext We use the command below as standard in our scripts, but I have also discovered that this is not entirely useful. But for more about that you should go to another section on this blog (see the Table of Contents). You probably found this blog cause of an … Continue reading FIX: Get-AzContext missing ‘subscription’ Az.Accounts PowerShell

How to import PowerShell 7 runbooks in Azure Automation

Import a PowerShell 7.XX runbook in Azure Automation via PowerShell You cannot currently choose PowerShell 7.XX runtime via the standard cmdlet New-AzAutomationRunbook in the Az.Automation module. This limits you to using the Azure portal. You can upload runbooks via a workaround with runtime 7.XX. This only applies to powershell script files located in an Azure … Continue reading How to import PowerShell 7 runbooks in Azure Automation

FIX: Azure Automation PS 7 not recognizing environment variables

Do I run the script (runbook) locally or in Azure Automation? I develop scripts or runbooks on my local machine and then run them against Microsoft Graph or Azure (REST API) and when the script is complete I upload them in Azure Automation as a runbook. I need logic in my script to see if … Continue reading FIX: Azure Automation PS 7 not recognizing environment variables

FIX: ‘else’ is not recognized as cmdlet Visual Studio Code debugger

Debugging Visual Studio Code and manually running an if else statement erroring If you look at the piece of code below, you would say this works. This works, but when you run this manually in the Visual Studio Code debugger, you get the following error: else: The term ‘else’ is not recognized as a name … Continue reading FIX: ‘else’ is not recognized as cmdlet Visual Studio Code debugger

How to optimize and speed up your PowerShell scripts

My best practices, tips and tricks working with PowerShell This is a blog post that is not deeply technical. I will not go deep into the tips and tricks, because you will learn this automatically when you have more experience & when you are ready. I have a seperate blog post about best practices, tips … Continue reading How to optimize and speed up your PowerShell scripts

FIX: Import-Module Az.Accounts in Azure Automation sandbox

FIX: The term ‘AZ.ACCOUNTS CMDLET‘ is not recognized as a name of a cmdlet, function, script file, or executable program I’m getting several errors in an Azure Automation runbook job, all of which amount to the same thing. I made a seperate error messages section, because it’s too much for the intro section! But the … Continue reading FIX: Import-Module Az.Accounts in Azure Automation sandbox

FIX: Parameter input shown as not recognized as a cmdlet AzA

My Parameter input is not recognized as a cmdlet in Azure Automation Nowadays, we roll out Azure and workplace features via a WebApp, such as Conditional Access or Privileged Identity Management for customers that need them. This speeds up the process of onboarding customers. We have adapted our WebApp in such a way that you … Continue reading FIX: Parameter input shown as not recognized as a cmdlet AzA

How to import a custom PS module in a VM or Azure Automation

Keep your PowerShell modules updated! We will do all of this with Azure Automation and PowerShell, you can also do this in a ci / cd pipeline, but that’s up to you. Disclaimer: Everything will be simplified, these are steps you can follow, but you must modify before it works in your own environment. What … Continue reading How to import a custom PS module in a VM or Azure Automation