Pester: pretty summaries

Short examples of a mix of passing and failing Pester tests being rendered in a browser, using ReportUnit, available on NuGet, and ingesting NUnit output format. Check out the browser screenshots below first for the end result.


# Runs all test suites, passes the output to the NUnit format, renders it, displays in a browser

# see my article here for installing nuget via Choco:



nuget.exe install ReportUnit

#Then, for example...

# Execute all the tests

$outputName = Get-Random

$outputFile = "$PSScriptRoot/$outputName.xml"

$htmlFile = "$PSScriptRoot/$outputName.html"

Invoke-Pester -PassThru -Strict -OutputFile $outputFile -OutputFormat NUnitXml

.\ReportUnit.1.2.1\tools\ReportUnit.exe $outputFile

Start-Process chrome $htmlFile

PowerShell: $PSScriptRoot…

$PSScriptRoot returns the parent of the current script/invocation.

This summarises:

Write-Output "1.`$PSScriptRoot:[$PSScriptRoot]"
Write-Output "2.Parent:[$(Split-Path -Parent $MyInvocation.MyCommand.Path)]"
Write-Output "3.Leaf:[$(Split-Path -Leaf $MyInvocation.MyCommand.Path)]"
Write-Output "4.Full path:[$($MyInvocation.MyCommand.Path)]"


GitHub: searching in your own repositories

While not immediately apparent to me, GitHub does have pretty good search. The root URL is, amazingly:

Also here in a new tab.

One example is enough, as the GitHub URL gives more detail. Note the syntax used is:

[search string](space)[literal "user:"][repo owner to search]

, as in:

Also note that you don’t seem able to enter wildcards…

Pretty much confirmed by this:

OK Google commands

  • OK Google (seems to activate more easily if you “train” it in Android)
    • Text [Jan mobile]
    • Call [Jan mobile]
    • get to [Slough]([by car] | [by bike])
    • Bluetooth [off|on]
    • Wi-Fi [off|on]
    • Wake me up in [3] minutes
    • Wake me up at [7 oh 2] am
    • Remind me to [buy milk] at [5 PM]
    • Where’s the closest [Caffe Nero]
    • What is my schedule for tomorrow
    • What is my schedule









PowerShell: AVI to mp4 conversion, and related

I’ve been using Handbrake CLI wrapped in PowerShell to convert some bulky old AVI files to MP4, and then to copy those to DVD for another layer of backup.

Some scripts here, here, here and here.

I have just finished a pretty extensive repo and Wiki on this subject, on GitHub, here. The intended audience for this is those who can find their way around Windows, but who know nothing about PowerShell.

I’ve now made a video here to illustrate just the AVI to mp4 conversion part.


PowerShell: find and remove duplicates

Credit here and here.

gci *.* -recurse | get-filehash -Algorithm MD5 | group -property hash | where {$_.count -gt 1 } `
| % { $ | select } | Out-GridView
gci -Recurse
gci -Recurse | Get-FileHash -Algorithm MD5
Gci -Recurse | Get-FileHash -Algorithm MD5 | Get-Member
Gci -Recurse | Get-FileHash -Algorithm MD5 | select -first 1 | Get-Member
Gci -Recurse | Get-FileHash -Algorithm MD5 | select -first 1 | Get-Member | Measure-Object
Gci -Recurse | Get-FileHash -Algorithm MD5 | group -Property Hash | where {$_.count -gt 1} | % {$ | select -Skip 1} | Remove-Item