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.
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:
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 :)
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.
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.