Automate AWS MFA Credential Renewal with OCR and PowerShell

Problem Statement Multi-Factor Authentication (MFA) is a relatively easy mechanism to improve the security of your Amazon Web Services (AWS) cloud environment. Instead of logging into the AWS Management Console using a username and password, you also have to provide a time-based one-time password (TOTP). The same concept applies when …

Continue reading

Finding an AWS EC2 AMI with the AWS PowerShell SDK

Problem Statement If you’ve ever launched an Amazon EC2 instance (aka. virtual machine), you’re probably familiar with the concept of an Amazon Machine Image (AMI). AMIs are simply virtual machine images that you can launch your EC2 instance with. Because anyone can publish a custom AMI, and because AWS has …

Continue reading

Control Bluetooth on Apple MacBook Pro from the Command Line

If you’re like me, you try to automate everything, even the small stuff. I have a few Bluetooth devices that I occasionally use with my MacBook Pro: Apple Magic Trackpad 2 Apple Magic Keyboard Bose QuietComfort 35 Sennheiser PXC550 Getting Bluetooth devices powered on and connected isn’t always the easiest …

Continue reading

Designing Command Line Tool User Experience

Linux Terminal Running Docker

Introduction Software developers, infrastructure & DevOps engineers, and operational IT staff are heavy users of the command line. The benefits of the command line are clear: Commands are / should be readable Commands are repeatable Commands can be shared amongst a team (eg. via source control / chat / etc.) …

Continue reading

Select Unique Lines in Bash on Linux

If you have a file with repeated lines, and you want to remove duplicate lines, you can use the uniq command. The description of this utility, from its man page is simply: “report or omit repeated lines.” Consider the following example: trevor@MyUbuntuVM:~$ echo “this is is great” | uniq The output …

Continue reading

Unicode Emojis in PowerShell!

Check out this post over at Art of Shell that talks about supporting emojis in PowerShell! The post starts out … We all use emojis, to some extent, on a daily basis. We write smiley faces in text messages, e-mails, on Twitter, on Facebook, and other social media platforms. These …

Continue reading

Azure PowerShell Extensions Updates

The Azure PowerShell Extensions module (AzureExt) for Windows PowerShell has seen another interesting update! Let’s take a look at some of the high-level changes: External dependencies have been completely removed The module now supports PowerShell ISE Snippets for Azure Resource Manager (ARM) Resources New command: Remove-AzureRmResourceGroupGui New command: Start-AzureRM Check …

Continue reading

PSA: Upload your PowerShell Modules!

For some time now, the PowerShell Gallery has been available, enabling the upload of PowerShell modules to a centralized repository. This repository provides an easily discoverable location from PowerShell 5.0’s PowerShellGet module. In order to install a PowerShell module in PowerShell 5.0, a user must simply type Install-Module -Name <ModuleName>. …

Continue reading

PowerShell Splatting: Overview

Have you ever been writing a PowerShell script, and looked at how wordy and long the command becomes? If so, you’ll want to familiarize yourself with the concept of PowerShell Splatting. This technique allows you to declare your PowerShell cmdlet parameters in a HashTable (aka. dictionary or key-value pairs), and …

Continue reading