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.
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
Every now and then, you run into a situation where you might need an SSL/TLS certificate. You could always generate a self-signed one – but that won’t be trusted by anyone, so that’s no bueno. You could also order one online, even for free – but that’s kind of cumbersome,…Continue reading How to export the SSL/TLS certificate from a website using PowerShell?
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
This article explains an annoying extra step (or a really nifty trick – depending on how you choose to look at it!) that you can take to make sure your PowerShell 7 is able to import a module that was developed for .NET Framework, instead of .NET Core. This is…Continue reading How to use Microsoft.Online.SharePoint.PowerShell with PowerShell 7?
This article explains how to “reactivate” all of your accounts stored in your az account by refreshing your sessions. You might need this if you suddenly run into a script that needs to iterate all of your subscriptions without you being there to sign in to each one of them.…Continue reading How to refresh all Az CLI subscriptions?
So, you’re running a PowerShell command that requires a connection to PowerShell gallery, but you run into an error message, somewhat like this: “Unable to find repository ‘https://www.powershellgallery.com/api/v2’. This can happen when you’re running something like Install-Module or Update-Module. This pretty much blocks you from doing anything that would require…Continue reading Solving “Unable to find repository ‘https://www.powershellgallery.com/api/v2’.”