This category contains my articles that, in one way or another, include the usage of PowerShell. That’s a lot of posts – such a large share of what I write about contains different configuration steps, and those are most often easiest to do with PowerShell.
While most of the time there’s a configuration option available using the GUI as well, creating a reusable and debuggable script is generally speaking the preferred option for me.
But what is PowerShell, exactly? If you’re reading this blog, you probably already know I’m not the biggest fan of reinventing the wheel – so I’m not going to reinvent the definition, either. The following is adapted from Microsoft’s documentation for PowerShell:
Windows PowerShell (PowerShell, or PoSh for short) is a Windows command-line shell that includes an interactive prompt and a scripting environment that can be used independently or in combination.
Unlike most shells, which accept and return text, Windows PowerShell is built on top of the .NET Framework common language runtime (CLR) and the .NET Framework, and accepts and returns .NET Framework objects. This makes it a powerful tool for most configuration and automation tasks.
Windows PowerShell introduces the concept of a cmdlet (pronounced “command-let”), a simple, single-function command-line tool built into the shell. You can use each cmdlet separately, but their power is realized when you use these simple tools in combination to perform complex tasks. Straight out of the box there’s over a hundred basic core cmdlets, and you can write your own cmdlets and share them with other users.
The Power of PowerShell certainly does NOT come from the environment itself or the built-in commandlets – not at all. It comes from the hugely useful modules written and published by vendors and community. The ones I mostly use are probably the modules for Azure, SharePoint, Exchange and PnP commandlets.
Azure offers this great offering that is in my mind underutilized still – managed certificates that they’ll renew for you. While the offering is called Azure App Service Certificates, they are not only limited to being used in App Services. Their biggest strengths lie in their ease of use, automation,…Continue reading How to export an App Service Certificate from Azure?
This article explains how to easily add additional headers to the Graph API calls you make in PowerShell using Invoke-PnPGraphMethod commandlet. There’s a convenient sample for you to copy-paste and some basic explanations on what we’re doing below. Background Every now and then, I need to make some Graph API…Continue reading How to add AdditionalHeaders to Invoke-PnPGraphMethod?
This article expands on my earlier article on automatically figuring out versioning in an Azure DevOps Pipeline. In the other article, you’d add Major and Minor versions as variables, and Patch (the last part of an x.y.z version scheme) would be incremented automatically. In this one, I’m describing how to…Continue reading Automatically get version number from project dependencies in Azure DevOps
Heh, this article is going to be another one of those “Drat, I should’ve known this” articles. But maybe it’ll be helpful for someone else as well! In this post I will explain how to get around the “Error: Invalid use of command line. Type “winrm -?” for help.” error…Continue reading winrm complaining “Error: Invalid use of command line.” – easy fix :)
In Azure DevOps, you sometimes have a project that’s being built with a certain .NET version. It’ll require that particular SDK version, and most typically that is defined in the global.json file. However, if you also need to install a certain .NET tool, running dotnet tool install MyBuildTool will fail.…Continue reading How to avoid global.json version conflicts in Azure DevOps