PowerShell: Extract the summary table from RoboCopy's log file

When automating the copying of files with RoboCopy I wanted to be able to interrogate the summary table at the bottom of its log file - shown below.

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         2         2         0         0         0         0
   Bytes :  328.45 m  328.45 m         0         0         0         0

To allow me to analyse the summary table I wrote a PowerShell Cmdlet that extracts it out into PowerShell objects, which I can then feed into other processes/scripts for analysis.

This means tasks like ordering the summary table or finding any failures are now really simple:

> Get-Content "C:\robocopy.log" -Raw | Select-RoboSummary | Sort-Object Type | Format-Table

Type       Total       Copied       Skipped       Mismatch       Failed       Extras                          
----       -----       ------       -------       --------       ------       ------                          
Bytes      328.45 m    328.45 m     0             0              0            0                               
Dirs       1           0            1             0              0            0                               
Files      2           2            0             0              1            0                     
> Get-Content "C:\robocopy.log" -Raw | Select-RoboSummary | Where{ $_.Failed -gt 0 }

The cmdlet is hosted as a gist on GitHub so feel free to make improvements.