Category Archives: Posts

Longer Posts

The case of the non-updateable DSC Resource

I’ve been working on something pretty cool here at Domain Tech. Well, I think it’s pretty cool. It’s a Powershell DSC wrapper around our CloudFormation-based server fleet, The Robot Army.

The idea behind doing it this way was to significantly streamline the config management, which in Robot Army v1 was a bit clunky and hard to manage, as well as being based on multiple templates, with multiple parameters specified in multiple places, with a concomitant risk of variance creeping in over time.

Anyway, there’s a full blog post in draft over at Domain Tech explaining Robot Army v2, and that’s not what I want to talk about today. What I want to talk about today is DSC Resource Schemas that don’t update. Continue reading →

The Bloatware of the Windows DevOps World

If there’s a piece of software that grows fast and just keeps getting slower, it’s my PowerShell profile. It’s so useful to just cram another module load in there, or add another check script, or Update-Help, or a snippet of code to give a thought of the day. Mine is getting up above the ten second load time mark, and is rapidly approaching fifteen seconds.

Why? Well, I do a lot. I initialize my AWS credentials. I load my warmup scripts and F5 Load Balancer stuff. I make sure PSCX and xWebAdministration are available, and that I’m running at least PowerShell 4.0 (did I mention I ship my profile around from box to box? Yep). I also create a few aliases and read myself a line from my favourite song. I even spin up an asynchronous job to Update-Help, and I’m considering adding a few extra lines of code so I only do updates like that once a day. And code never gets removed, no way. What if I need it?

So it’s getting slow.

Well, I tweeted about this, and a mate tweeted back “you should implement a progress bar, so it at least seems like it’s loading quicker”.

Bloody good idea.

Luckily for me, Powershell supports progress bars natively. If you’ve done an Update-Help, you’ll have seen it. You’ll have also seen it if you’ve fired off an Invoke-WebRequest with an -outfile parameter pointed at a large-ish file. And what’s more, they’re pretty easy to use.

Here’s the basics

Your activity will appear in the First line. Your Status will appear in the second line. The pecentcomplete, obviously enough, defines how far along the progress bar is filled.

This is so absurdly easy, I’m surprised how few people use it. People still spit output to Write-Host (I certainly do), or at best Write-Verbose. Well, this doesn’t stop you doing that, but it’s a simple, neat way of showing progress. It’s good UX to let people know how much work has been done and how much remains and also it’s cool. Cool things are cool. You should totally use Write-Progress.

In Just One Hour I will make you a PowerShell Ninja

I just delivered the first session of a series here at work, running our C# and mobile devs through the basics of PowerShell, which is a pivotal component of our DevOps strategy. Here’s the slide deck, via SlideShare.

The real meat of the content is outside of the slides themselves, in the presenter notes and in the live code we type as we go through, but the slides will give a feel for what the session is like.

The Domain Train

So anyway, Innovation Day was coming up at work. Every so often, we all take a day out from our normal sprints and get let loose on ideas.

This is usually aimed at developers and product guys rather than the ops side, so what was I to do?

Well, I figured I’d take the concept of a software release train and… make it real. Every time we deploy new code, I want a train to leave the station and do a little loop before shutting down until the next deployment.

So on the Saturday before Innovation Day, I went shopping, and came home with an Arduino experimenter’s kit, a relay driver, some bits and pieces of wire and a Hornby Caledonian Belle model railway set. And this is what I built (apologies for the portrait mode film, I’ll have a better one after demo day tomorrow)

Continue reading →

Powershell DSC to configure Octopus Deploy Tentacles? Check

I wanted to make sure of sharing this because it really saved my bacon this week. There’s a longer post in the pipeline, possibly over at Domain’s forthcoming Tech Blog, but here’s the meat.

For the last couple of sprints I’ve been working on an end-to-end CloudFormation/DSC solution to stand-up new load-balanced, auto-scaling, self-healing, IIS8.x clusters ready to host various websites and microservices.

End-to-end of course means everything. No-touch from running the initial New-CFStack call to, 20 minutes later or so, hitting the LB in a browser and seeing our app-code in production.

Among the many pre-requisites for this is a configured Octopus Deploy Tentacle, and that’s what I’ll chat about here for a moment.

Continue reading →