Skip to content

Conversation

@jantari
Copy link
Contributor

@jantari jantari commented Oct 29, 2020

I noticed on machines using a system language other than english, the folder sizes when using -UseRobo were all returning 0.

Looking into it, this was because the $expectedSummary regex did not match the output from non-english robocopy versions (yes, unfortunately Microsoft localizes many CLI tools in Windows ...)

I adapted the Regex to so that it should handle most languages.

A sample output from german robocopy is:

------------------------------------------------------------------------------

            Insgesamt    KopiertÜbersprungenKeine Übereinstimmung    FEHLER    Extras
Verzeich.:        239        239         0         0         0         0
  Dateien:       1892       1892         0         0         0         0
    Bytes: 2968068139 2968068139         0         0         0         0
   Zeiten:    0:00:00    0:00:00                       0:00:00   0:00:00
   Beendet: Donnerstag, 29. Oktober 2020 14:20:57

I replaced all "hardcoded" texts with [\w\.]+ because the .NET regex engine matches Umlauts as well as other international characters (such as 日本語) with \w and sometimes robocopy abbreviates long words with a . (as can be seen in the above example).

An example regex to test this is: 'Übereinstimm.日本語' -match '[\w\.]+'


I also defaulted the thred count to the processors available threads, because 16 might be a bit high for some (older) laptops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants