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

Simple PowerShell File Picker V2

- - posted in powershell, tip | Comments

I made a couple of changes to the function to support recursively stepping into directories. I started messing around with this snippet in order to reproduce the functionality of using the Windows OpenFile dialog with a one-liner. Now it’s a bit more than a one-liner, but the GridView UI is actually pretty useful if you don’t know exactly what file you’re looking for.

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.