Using .NET With PowerShell

This goal of this post is to explore some .NET classes that may be useful to sysadmins and PowerShell devs without .NET (C#, etc.) experience, with a bit of a deeper dive into some concepts when warranted. By the end, you’ll be familiar with several .NET classes and understand…

Introducing Errors Into HTTP Requests For Resilience Testing

I’ve recently been playing with Polly, a .NET library for adding resilience to code where transient faults may occur. It allows policies to be defined that enable retires, timeouts, rate liming and a host of other options. As a simple example, you can specify that your HTTP API…

Adding All Projects To A .NET Solution With Dotnet CLI And PowerShell

I’ve recently spent a bunch of time learning C# and ASP.NET and I often find myself creating multiple projects and wanting to add them all to a Solution with one command rather than individually. I primarily use the CLI for managing projects and solutions so I worked out a…

Getting Uptime With PowerShell - The Fast Way

Getting uptime using WMI with PowerShell There are already a ton of posts about getting system uptime with PowerShell, and most of them use a WMI call to . Something along the lines of this: Getting uptime using [System.Diagnostics.Stopwatch] with PowerShell The issue with the…

Using ChatGPT API To Generate Git Commit Messages With Powershell

Git commit messages introduce a little bit of friction when I’m writing code. I tend to get stuck trying to come up with the perfect message, similar to the character creation screen in an RPG. So armed with an OpenAI account and API access, I decided to test handing over the…

Automating Remote Desktop Connection to Azure Lab VMs using PowerShell

Last few posts have been rather lengthy so here’s a quick one. Recently I’ve been doing a lot of lab work in Azure and found myself often creating numerous Windows VMs and needing to RDP into them once the provisioning process was done. There are of course numerous ways to…