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 process, especially if you have … Read moreControl Bluetooth on Apple MacBook Pro from the Command Line
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.) Automation is scalable across many … Read moreDesigning Command Line Tool User Experience
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 of the above command looks … Read moreSelect Unique Lines in Bash on Linux
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 emojis are defined in the … Read moreUnicode Emojis in PowerShell!
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 out Art of Shell’s Microsoft … Read moreAzure PowerShell Extensions Updates
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>. The module gallery is still … Read morePSA: Upload your PowerShell Modules!
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 then “splat” those parameters onto … Read morePowerShell Splatting: Overview
Introduction PowerShell 5.0 includes a module called Microsoft.PowerShell.Archive, which enables you to compress and extract ZIP files from the command line, or inside your PowerShell scripts. If we use the core PowerShell Get-Command, we can dynamically discover the commands that are available inside this module. You should already be familiar with the Get-Command command if … Read moreCompress & Extract ZIP Archives with PowerShell
If you’re authoring PowerShell scripts that are intended to be interactive, there are a couple of very easy ways to ask your users for input. Typically, user input falls into a couple categories: free-form text input, or a list of pre-defined values. We also might need to prompt the user to type in a secure … Read moreWriting Interactive Scripts with PowerShell
If you’re working with data from PowerShell, you have most likely come across the CSV (Comma Separate Values) format. These files are very easy to work with in PowerShell, thanks to the CSV cmdlets. If this is your first time working with CSV files, it’s easy to discover the CSV-related commands in PowerShell. Create Some … Read moreWorking with CSV Files in PowerShell