Recent Posts

A PowerShell stopwatch for your Profile.ps1

2 minute read

Boe Prox blogged/tweeted recently about how you can start a stopwatch in PowerShell with one line using the command [System.Diagnostics.Stopwatch]::StartNew(). While there are plenty of other ways to measure time in PowerShell (e.g measure-object, new-timespan), I could see an adhoc stopwatch being useful on occasion. However the raw class name is a bit clunky and forgettable. Therefore as a bit of fun I have created it as a series of functions in my PowerShell Profile.ps1 with friendly names I could call when needed.

Three things you might not know about Import-module

1 minute read

In Powershell the Import-Module cmdlet allows you to extend the cmdlets available to you within your script or console. This can be official extensions, such as the activedirectory module that is included with AD Tools, or custom modules you have written yourself to group together a useful set of functions or commands. This post briefly covers a few tricks i’ve discovered about import-module that i’ve found repeatedly useful.