Itty Bitty Rants

Infrequent posts about stuff.

  • Pretzels!

    I made pretzels for the first time yesterday! I was expecting them to look like a complete mess and possibly not even identifiable as pretzels but over all I think they turned out pretty good for a first attempt. I used the Alton Brown recipe and it was pretty simple to follow, even though their site is a huge mess. My first batch of pretzels A couple of notes for next time:

    Read more…
  • I Quit Twitter Today

    The week before the US election I decided I was going to take a break from Twitter for at least two weeks. In order to make that decision actually stick I even went as far as uninstalling the app from my phone. For the following several days I found myself randomly picking up the phone and mindlessly unlocking and tapping where the app icon had been. It was kind of enlightening about how I had been using it and how it had been fitting in to my day to day.

    Read more…
  • Is This Thing On?

    This is just a post to see if IFTTT integration is working to automatically post to my Twitter account…

  • Some Migration Notes

    As I mentioned in the previous post I am hosting this blog on Azure Static Web Apps now using Hugo as my generator. That transition was definitely not without quite a few bumps along the way. I first started to work on this transition about 4 years ago when it was necessary to generate quite a bit of Azure infrastructure to make it work, including some hacks to make default pages for folders work properly, so it never quite got done until today.

    Read more…
  • Finally!

    It’s been a long time in the making but I have finally transitioned this site to a static generated site being hosted on Azure. This past spring at Microsoft’s Build conference they released a new product in preview called Azure Static Web Apps that HUGELY simplified setting this up. It’s kind of funny because the previous weekend I had finally gotten back to starting to work on this transition and had gotten some build pipelines setup for all of the terraform for the infrastructure and now it turns out that absolutely none of that is needed anymore!

    Read more…
  • Dusting off the cobwebs a bit

    Over the past couple of years since I last added a new post to this blog I’ve been halfheartedly working on converting from WordPress to one of the modern static generators but luckily a recent involuntary, but somewhat welcome, change in employment has freed me up to finally (hopefully) make some progress on that front. With any luck I’ll have the site updated to new hosting and back-end by the end of the year.

    Read more…
  • Differing output from Where and Where-Object

    One of the lesser known features of PowerShell are some “magic” methods that get added to most (all?) collection objects that replace the slower Where-Object and ForEach-Object cmdlets with basically the same functionality. They’re considered magic because they aren’t well documented even years after they were introduced. (Thank goodness for bloggers) I’ve used ForEach quite a bit, but often forget about it’s Where counterpart and apparently had never actually done much with it until today when I ran into a weird issue where I couldn’t set the value of a property on a returned object.

    Read more…
  • Finding an item in an array of PSCustomObjects

    (This is mostly so I can find it again someday when I need it again.) When working with REST interfaces with PowerShell it’s pretty common to get JSON responses that have information that is returned as arrays of PSCustomObjects. If you need to update a property of one of those objects you can’t just do something simple like: PS C:\> ($result.objArray | Where-Object { $_.name -eq "whatever" }).value = "SomeNewValue" In order to set the value of a property you’re going to have to find the index of that particular object in the array and then manipulate it directly.

    Read more…
  • Standardized Tests for Standardized Parameters

    Something that you find when writing PowerShell modules to wrap API functions for external systems is that a lot of your functions tend to have a consistent subset of parameters that get used for things like credentials and specifying an endpoint. For example in the private TeamCity module that I maintain the parameter block for every function that interacts with a server has: [Parameter(Mandatory=$false)] [System.Management.Automation.PSCredential]$Credential = ( Get-Credential -Message "Please enter your credentials for the TeamCity server at $server"), [Parameter(Mandatory=$true)] [ValidateNotNull()] [string]$Server (Whether that is the best pattern I’m still not sure, but it’s beside the point of what I’m talking about here.

    Read more…
  • Reporting Pester Code Coverage Metrics to TeamCity

    As previously mentioned I’ve been doing a lot of work with PowerShell modules at work where I have recently gotten all the parts for a full continuous delivery pipeline working for those modules. A big section of that pipeline runs through TeamCity and while the existing ability to have Pester test results show up in the build results is really great, code coverage is slightly less obvious but in the end fairly simple.

    Read more…