The Wonderful World of PowerShell Filtering and Globbing

If you’ve been using PowerShell for long, you are probably familiar with the concept of wildcards. At the very least, you’ve done something like this: PS C:\temp> dir *.txt Directory: C:\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 1/21/2015 10:01 AM 664 test.txt Or perhaps you’ve taken a lap or two around about_wildcards and now type things like this in your sleep: PS C:\temp> dir C:\win*\*.N[a-f]?\F*\v2*\csc.exe Directory: C:\Windows\Microsoft.NET\Framework\v2.0.50727 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 5/26/2014 9:39 PM 77960 csc.

Extracting Tables from PowerShell's Invoke-WebRequest

If you’ve ever wanted to extract tables from a web page in PowerShell, the Invoke-WebRequest cmdlet is exactly what the doctor ordered. Once you’ve invoked the cmdlet, the ‘ParsedHtml’ property gives you access to the Internet Explorer DOM of that page. From there, you can get elements by tag name (“TABLE”), ID, and more. One neat application of this technique is to automatically parse data out of tables on the web page.

Maslow's Hierarchy of Security Controls

You’ve probably heard of Maslow’s Hierarchy of Needs. It’s a useful way to think about human needs and the priority in which we tend to fulfill them. Somebody dealing with a physiological crisis such as lack of food and water is unlikely to improve their situation much by focusing on self-actualization issues like finding opportunities for their artistic expression. When thinking about an organization’s security stance or security controls, I find that there is a very close parallel to Maslow’s Hierarchy of Needs.

Saving yourself from Sender's Remorse with Outlook

tl;dr summary: Create an Outlook rule to “delay outgoing mail by <5> minutes”, “unless body contains: е”, where the character used for the body exclusion comes from typing ALT+1077. “When it comes to email, it seems that I always do my best proof reading immediately after I press the Send button.” Perhaps you’ve been in the situation before, where you immediately regret sending an email in anger. Or realize after a few more moments of reflection that the email you just sent was well and truly wrong.

Repairing a NatureBright SunTouch Plus

I recently had the misfortune of having my relatively unused NatureBright SunTouch Plus break down: It’s a “Light Therapy” box that is very popular on Amazon, but a recurring problem among the disappointed reviews seems to be that it turns on, but then just immediately clicks and then turns off again. My lamp was out of warranty, so I decided to look into whether it was possible to fix it myself.

Absolute Positioning in Autodesk 123D Design

If you’re looking for a way to position an object in an exact spot in Autodesk 123D Design, you might have stumbled on forum topics like: The last meaningful response was: It doesn’t appear to have been added yet. Or it has been newly added, and the usability leaves something to be desired. In any case, it’s not as easy as you might think, but here’s a technique that works in version 1.

Playing with Classes in PowerShell v5 Preview

One of the features we’re working on in the latest version of PowerShell is the ability to define custom classes. If you’ve ever used a PSCustomObject or a Hashtable in a script for storing related data, you’ll probably find classes to be a useful addition to your scripting toolkit. $point = @{ X = 0; Y = 0 } $point.X = 10 $point.Y = 20 While PSCustomObjects and Hashtables let you group related data, what if you want to perform actions on that data?

Creating an Easy PowerShell Uptime Monitor

In a recent post, I blogged some data based on an uptime monitor I put together when I started having problems with my (then) web hosting platform. Here’s how it works. The first step is a script, Test-Uri. This essentially runs the Invoke-WebRequest cmdlet and captures the important details: Time, Uri, Status Code, Status Description, Response Length (so you can detect drastic content changes or incomplete responses), and Time Taken.

Arvixe Status Report

In 2010, I posted about my woes with WebHost4Life (which I’m shocked is still around.) I looked around for another host, and ended up going with Arvixe. I’ve been happy with them ever since. In the comments, Sebastian wrote: Sebastián Cañizares writes: Arvixe is the same problem … they say “We are currently facing network issues across at least one of our facilities The packet loss is disrupting service” and after 3 months my site still has the problem … the site going up and going down …

Handle Hitch Knot for Pulling Thin Rope

If you’ve ever tried to pull hard on thin rope (maybe to tighten slack in a line), you’ve probably wrapped the rope around your hand and felt it dig in as it constricted around your fingers. Here’s a knot that solves the problem – I call it the Handle Hitch. I couldn’t find it anywhere else – if you’ve heard of it and it has a name, I’d love to know.