Automated Ops

Put down the GUI
and step away from the
Remote Desktop Connection

about me

I’ve been managing SaaS built on Microsoft infrastructure for over a decade. I spend most of my time trying to figure out how to replace humans with automation.

recent public projects

Status updating…

found on

Wasted Time

- - posted in IT, powershell | Comments

I have been sitting here staring at my computer for over two hours now. Essentially locked out of my system for a full disk virus scanned enforced by The Man (aka Corporate IT). The scan thrashes my slow laptop harddrive so much that opening even a simple web page requires a buddhist monk’s level of patience. The job has a runtime limit of two and a half hours.

New Relic Is a Bit Sweeter

- - posted in automation, devops, projects, tools | Comments

I’ve been working with New Relic a lot in recent weeks and have deployed their agent several times. Obviously, this required some automation and the best way to automate software installs on Windows is Chocolatey. Unfortunately, New Relic didn’t publish their agents to Chocolatey and the existing packages were out of date.

I brought up the request on the user forum and New Relic expressed interested, but also said, “feel free to give it a try yourself.” So, I did.

Messing With Photos in PowerShell

- - posted in .net, powershell, tools | Comments

In continuing with the habit of building wrappers around .Net libraries mentioned on Scott Hanselman’s blog, I have written a module around James M South’s ImageProcessor.

Here’s an example.

1
2
3
4
5
6
Get-PIPImage -Path C:\Pictures\DSC06199.JPG | 
    Set-PIPImageSize -Width 500 -Height 500 -MaintainAspect | 
    Add-PIPFilter -Filter lomograph | 
    Add-PIPRoundedCorners | 
    Set-PIPImageFormat -Format Png | 
    Save-PIPImage -Path c:\temp\whisky.png

And here is the result.

Humanize Follow-up

- - posted in .net, powershell, tools | Comments

Humanizer helps you generate some nice output, but it’s kind of a pain to use in PowerShell. You can use Update-TypeData to make the syntax easier to work with. Then, your code starts to look more like the examples on the project’s site.

Here’s a simple example.

1
2
3
4
5
6
7
8
9
10
Add-Type -Path C:\Humanizer\Humanizer.dll

Update-TypeData -TypeName System.Int32 `
    -MemberType ScriptProperty `
    -MemberName ToWords `
    -value {[Humanizer.NumberToWordsExtension]::ToWords($this)}

PS C:\temp> $int = 1234
PS C:\temp> $int.ToWords
one thousand two hundred and thirty-four

Humanize Your Scripts

- - posted in .net, powershell, tools | Comments

This is a quick example of some of the stuff you can do with Humanizer to make your script’s output a bit more user friendly.

Strings from numbers.

1
2
3
4
5
6
7
8
PS C:\temp> [Humanizer.NumberToWordsExtension]::ToWords(2)
two

PS C:\temp> [Humanizer.NumberToWordsExtension]::ToWords(253)
two hundred and fifty-three

PS C:\temp> [Humanizer.ToQuantityExtensions]::ToQuantity("box", 4)
4 boxes

Book Review: Thinking, Fast and Slow

- - posted in books, decision-making | Comments

I finished this book a few weeks ago and have struggled with how to write a review. Thinking, Fast and Slow by Daniel Kahneman is the most epic self-help book I have ever read. It’s also different in the fact that there is no “do this or that to live a better life” type advise, but simply over 400 pages of examples of hour your brain can fail you in so many situations.

Test All the Things

- - posted in .Net, PowerShell, Psate, Testing, Tools, WatiN | Comments

This is a follow-up to my last post on using PSate for test automation. I demonstrated running Invoke-WebRequest and validating the StatusCode as a simple test for if a site is available. Now let’s take it to the next level and run an artificial transaction. Again, PSate is a handy test runner to manage this and the open-source project, WatiN (pronounced as What-in) is a great tool for automating a real browser.

Test It With Psate

- - posted in PowerShell, Psate, Testing, Tools | Comments

Recently I have been putting effort into learning the art and science of unit testing using Pester and PSate. I was going to write up something on my experiences, but Jakub JareŇ° beat me to it with this good article on PowerShell Magazine. If you are new to the idea of unit testing, go read that article and then come back here.

So, what is the point of this article? I was working on an unusual maintenance recently and it was around 4 in the morning and it occurred to me that it would be nice if I had a big dashboard that showed everything was “green”.

One Year

- - posted in blog, devops, opinion | Comments

I happened to look through all of the previous posts today and found that 2/25/2013 was my first. So, that makes a year and by no conscious effort, 52 posts—one a week on average. The site receives about 500 visits a month from over 40 countries.