Developer VM

Setting up Hyper-V VM using powershell

It is not uncommon in consulting to work out of dedicated VMs for each customer. This helps create a strong segregation between internal and each client workstream. If you use Hyper-V, chances are that you already have a template VM and use copies of it, so you don’t setup everything over and over. In this post, I will do exactly that, but introduce as much automation using PowerShell as possible....

August 28, 2022 · 5 min · LPains
Developer Environment

Automated and repeatable Developer Environment setup - winget

Back in March I posted about Automated and repeatable Environment Setup. In that version of the environment setup, I used Chocolatey because it has always been my go-to Windows app installer. However, the latest versions of Windows 10 and 11 comes with winget pre-installed. In this post, I will show how to setup a similar developer environment but using winget instead of chocolatey. Similarly to the last post, I will focus on a typical ....

August 25, 2022 · 3 min · LPains
Locks

Convert PFX to PEM for AWS Certificate Manager

When adding a certificate to AWS Certificate Manager, you need to have the certificate’s PEM encoded body, private key, and certificate chain. Note that unless you have a self signed certificate, you will need the certificate chain. If your cert has a chain but you don’t include it AWS will tell you an error occurred but it won’t tell you what’s wrong. I had to try and fail a few times before it worked....

March 9, 2022 · 2 min · LPains
Developer Environment

Automated and repeatable Developer Environment setup

First post of 2022 in March? Sorry for that, it took a while to get traction this year. I have a habit of “starting over” with my development environment once a year at a minimum. That means that I reinstall the OS from scratch and all my tools. This is actually fun and not hard to do at all, but can it be automated? Yes, powershell + chocolatey is a good answer to this....

March 7, 2022 · 4 min · LPains

Simple prevent write commands in SQL Server

On multiple occasions, I found myself trying to check if a query for data read is safe to execute or not. This is typically useful when the query is saved outside of your code, and you cannot restrict the access level of the user executing it. The following regex, while not exhausting by any means, will detect most query patterns typically used to change data. Note that inserts, updates, deletes, and merges are permitted on temporary tables (e....

May 25, 2021 · 1 min · LPains