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: This file can’t be previewed because of an error

This file can’t be previewed because of an error in the Microsoft Word Previewer The tutorial below is written for Outlook where you cannot open the attachments and for File Explorer where previews cannot be shown. I don’t yet understand exactly why this problem arises. The tutorial below is therefore not a real fix, but … Continue reading FIX: This file can’t be previewed because of an error

FIX: VSC source control show unknown files to commit to branch

Committing 10k+ files to a branch you haven’t heard of (or even main/master)? The tutorial can work for other tools using git as well. Do you see a list of changes in Visual Studio Code Source Control? A list of changes that don’t seem familiar to you, like below? Directories, git, source control and unknown … Continue reading FIX: VSC source control show unknown files to commit to branch

FIX: Teams channel cannot be unpinned

Pinned Teams channel is not unpinned I had created a temporary channel that I used to send emails from development that contained errors. These were mainly used for bug fixes and other purposes. It also has the delightful name ‘ACCEPT – Error’. Because I was working on this, I pinned the channel so that it … Continue reading FIX: Teams channel cannot be unpinned

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: [ERROR] Error while parsing Markdown front matter

This can happen if you use special characters in front matter values (try using double quotes around that value). ??? At work we have an internal docs site that runs on an Azure static web app. The site uses Docusaurus. Docusaurus is an open-source documentation framework that makes it easy to create, maintain, and deploy … Continue reading FIX: [ERROR] Error while parsing Markdown front matter

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: The system cannot find the file specified dcsvc Services.msc

How to fix The system cannot find the file specified for the dcsvc service I often use Get-Service as an example in my blog posts about PowerShell. I wanted to do this again, but suddenly ran into an error while getting the Services from my local device. When trying to open the properties within the … Continue reading FIX: The system cannot find the file specified dcsvc Services.msc