In my latest module, PSTerminalBoom, I encountered a challenge: how to pass external data into the Register-ScriptFeedbackProvider script block. Unfortunately, $using: didn't work in this context due to the implementation of the function itself. So, ...
HCRitter
In a recent scripting endeavor, I developed a PowerShell script with an ArgumentTransformationAttribute. The script's purpose was to convert PSCustomObjects or Hashtables into a JSON format tailored for seamless integration with a BatchRequest destin...
HCRitter
Recently, I participated in AdventOfCode 2023 and encountered challenges that required finding the precise location of a character in a string, along with all its occurrences. Take, for instance, the string 'Hello, world!'. I needed to identify all p...
HCRitter
In the rapidly evolving landscape of Entra ID, the use of App-Registrations has become increasingly prevalent, empowering users to seamlessly leverage PowerShell and the Microsoft Graph API for fundamental tasks in Exchange-Online, Entra ID, Intune, ...
HCRitter
Introduction: Efficiency is key when working with PowerShell, and maximizing performance is a common goal for script developers. In this post, we'll explore various techniques for retrieving the maximum number from arrays of different sizes, comparin...
HCRitter
In the realm of PowerShell, determining the version of the operating system is a common task for sysadmins. However, when it comes to reporting, extracting additional details, such as the Update Build Release (UBR), becomes crucial. While the Winver ...
HCRitter
Enhancing PowerShell with GetValueOrDefault: A Neat Solution for Streamlined Hashtables Have you ever wondered why the Hashtable in .NET lacks a GetValueOrDefault method, a feature readily available in basic Dictionaries? In my quest to streamline my...
HCRitter
PowerShell-Technique: Smart Aliases
PublishedPowerShell-Technique: Smart Aliases Utilizing Non-existent Functions in PowerShell Introduction In a recent project of mine, PSMermaid, I had the privilege of exploring a fascinating technique called 'Smart Aliases,' which was introduced to me by the...
HCRitter
Simplifying Creation of Empty PowerShell PSCustomObjects using Custom Functions Creating an empty PSCustomObject in PowerShell is a common task, but the traditional approach can be verbose and repetitive. In this blog post, I'll walk you through a mo...
HCRitter
When using PowerShell, many users often rely on the like comparison in a where statement for querying data. However, there is an alternative method that can be faster, especially when searching for strings that start with specific letters. This metho...