HCRitter

@hcritter

433 Points 2 Followers

24 Posts

0 Answers

A PowerShell Devblog

HCRitter · 3 months ago

Simplifying PowerShell Object Validation & Transforming: A JSON-Schema Refactoring Journey

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...

HCRitter · 4 months ago

PowerShell-Technique: PowerShell: Getting all String occurrence Indices

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 inst...

HCRitter · 5 months ago

PowerShell: Securing App-Registration with Application Access Policy

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...

HCRitter · 5 months ago

PowerShell Perfomance-Test: Get the Maximum

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...

HCRitter · 5 months ago

PowerShell: Retreive the Update Build Release (UBR)

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 Up...

HCRitter · 6 months ago

PowerShell: Add GetValueOrDefault Method to a Hashtable

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 a...

HCRitter · 7 months ago

PowerShell-Technique: Smart Aliases

PowerShell-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 techniq...
1

HCRitter · 8 months ago

PowerShell: Creating an "empty" PSCustomObject

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 a...

HCRitter · 10 months ago

PowerShell Performance-Test: Like and Equals string comparison methods.

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 search...

HCRitter · 11 months ago

PowerShell-Script Showcase: Get-WifiPassword

PowerShell is a powerful scripting language that can be used to automate a variety of tasks. In this blog post, we will explore my Get-WifiPassword script that retrieves stored Wifi password...
2

HCRitter · 1 year ago

Book-Review: Practical Automation with PowerShell

Lately I had the chance to get a copy of the book: "Practical Automation with PowerShell". This is not a paid review just my honest thoughts about it, because after reading I am st...

HCRitter · 1 year ago

PowerShell-Technique: Randomizing

PowerShell-Technique: Randomizing PowerShell is a powerful tool for automating tasks and managing systems, and one of its useful features is its ability to generate random values. In this po...

HCRitter · 1 year ago

PowerShell Performance-Test: File Reading

PowerShell Performance-Test: File Reading - Which method reads a file the fastest? There are several methods and ways to read the content of a file in PowerShell, with the most commonly used...

HCRitter · 1 year ago

PowerShell-Technique: Switching

Enhance Your PowerShell Scripting with Switch Statements Have you ever found yourself writing a lot of if/elseif/else statements in your PowerShell script? You may have heard of the switch s...
1

HCRitter · 1 year ago

PowerShell-Technique: Update-TypeData

Enhancing PowerShell objects with Update-TypeData Sometimes the objects that PowerShell cmdlets return don't have all the properties and methods that you need. Fortunately, PowerShell provid...
2

HCRitter · 1 year ago

PowerShell-Technique: Trapping

Enhance Your PowerShell Scripting with Trapping This blog post explains how to use the trap statement in PowerShell to improve error handling, reduce code size, and make scripts more organiz...
1

HCRitter · 1 year ago

PowerShell-Technique: $PSDefaultParameterValues

Enhance Your PowerShell Scripting with Default Parameter Values In this post, we'll take a closer look at the benefits of using default parameter values in PowerShell. As we previously explo...
2

HCRitter · 1 year ago

PowerShell-Technique: Splatting

How Splatting in PowerShell Can Improve Your Code's Aesthetics and Reduce Volume Have you ever found yourself struggling with long, unwieldy PowerShell commands? You're not alone. Backtickin...
1

HCRitter · 1 year ago

.NET or not .NET - Where

Dotnet or not Dotnet this is the question we will ask in this post Lets find out if the .NET .Where() method is significantly faster than their equivalent in native PowerShell In this post,...
1

HCRitter · 1 year ago

String concatenation performance boosting

String concatenation performance boosting - is this too much ado about nothing? Concatenating strings is a common operation in programming, but did you know that there are different methods...

HCRitter · 1 year ago

.NET or not .NET - ForEach

.NET or not .NET this is the question, we will ask in this post Lets find out if the .NET .ForEach() method is significantly faster than their equivalent in native PowerShell The most of us...

HCRitter · 1 year ago

Padding and Parameters

Today I would like to show you special interest topic: Padding and Parameters This post won't cover all off the aspects of parameters in PowerShell or neither everything you can do with the...

HCRitter · 1 year ago

3 ways to sort a list unique

Today I would like to show you a performance table comparing different ways to sort a list/array unique. Sometimes it is necessary to sort a list or an array unique to get rid of duplicates...

HCRitter · 1 year ago

[Microsoft.Win32.Registry] VS Set-ItemProperty

Today I would like to show you a performance table comparing different ways to write to the registry. Writing to the registry is more or less a standard task while working as an administrato...
1

Loading More Content