Unix Philosophy

I’ve been thinking recently about how learning PowerShell and Elixir have had an influence on my day job working with C# and was reminded of two quotes from the early Unix days that seem appropriate.

Read more

Linting in PowerShell

Continuing the theme of C++ flavoured tools I miss, lint is another essential that doesn’t appear to exist in the PowerShell world. Until I discovered ScriptAnalyzer which, it seems, can do pretty much the same job for .ps1 files. Here I wrote a simple loop to check all files in the same directory.

Read more

Configuration Files in PowerShell

Developing a mini build and configuration system with PSake recently and was getting annoyed with the number of hard-coded, machine- and environment-specific strings there were so I did some research on alternatives to storing configuration files external to the script. Once again, the PowerShell team have thought about this and provide a solution in the shape of a psd (PowerShell Data) file - .psd1. Data can be structured hierarchically either as key value pairs or hashes. The easiest way to create a file is to generate it from a scratch script using a here string:

Read more

Microbit Ghost Detector

Just in time for Halloween, here’s a ghost detector that uses the microbit temperature sensor to sense changes in ambient temperature - which we all know from watching supernatural tv shows - is a sure sign that there’s a ghost somewhere nearby :)

Read more

Grepping in PowerShell

One tool I really miss sometimes is grep, the command line tool for searching for text matches inside an arbitrary set of files. In the same way you might use “dir” to find a file inside a directory that matches a name pattern, or another outward-facing characteristic like file attribute, you can use grep to find any files containing matching text.

Read more

Joy in Learning

Our schools must preserve and nurture the yearning for learning that everyone is born with. Joy in learning comes not so much from what is learned, but from learning.

W. Edwards Deming

Read more

PSake Cheatsheet

PSake is a PowerShell module, similar to msbuild, that allow you to parcel up chunks of code into discrete Tasks and create dependencies between them. PSake then determines the order they should run and handles that complexity. Here are the highlights of functionality I use all the time.

Read more