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 explains how to fix an issue when updating a module in PowerShell. The error is something along the lines of: “System.InvalidOperationException: PowerShell Gallery is currently unavailable. Please try again later.” The whole error looks something like the one below, although you can probably get it for many different…Continue reading How to fix “System.InvalidOperationException: PowerShell Gallery is currently unavailable.”
As Teams adoption grows (partially driven by the megatrend of digitalization, partially by the massive surge in working from home due to Covid-19), different problems managing Teams also become more obvious. The growth seems to have been largely organic. Teams and organizations are adopting the tools that best help them…Continue reading How to fix a Teams team with no Owners?
I plugged Obfuscar into my build pipeline (the easiest configuration ever, by the way) because I needed to obfuscate a DLL I was going to push as a NuGet package. The DLL was obfuscated without changing any of the public APIs, Classes or Parameters – only internal stuff was scrambled.…Continue reading Obfuscar 2.0 errors with loading types from assembly
This post describes a few different things that can (and will) go wrong when you’re trying to load DLLs in PowerShell, and a couple of ways you can try to fix them. Typically, you’d run into an error message like “Exception calling LoadFrom with 1 argument(s): Could not load file…Continue reading How to resolve issues when loading DLLs in PowerShell?
There are a thousand possible things that can throw a “Microsoft.SharePoint.Client.ServerException”, but fewer things, that are ambiguous enough to be called “Unknown error”. This post describes one fairly usual fix for this issue! But let’s get back to the beginning for a second – you get what and when now?…Continue reading Solving yet another “Microsoft.SharePoint.Client.ServerException: Unknown Error”
Whoops. This could happen to anyone since the Azure PowerShell (approximately) version 6.3.0 will cache your credentials between sessions without warning you. It’s really easy to run your commands with cached accounts and end up executing your scripts against the wrong environment. In less serious cases, this means that you’ll end up…Continue reading Oh no! PowerShell cached my Azure credentials and I messed up wrong customer’s environment!