jseerden/IntuneBackupAndRestore

Compare-IntuneBackupDirectories fails for plicies with [] in the name (like Autopatch policies)

Opened this issue · 0 comments

ztrhgf commented

Compare-IntuneBackupDirectories uses LIKE operator for searching the difference files, but when policy/file contains [xxx] in its name, search fails, because LIKE treats this as sort of wildcard instead of literally searching for the string as it is.

Solution is to use MATCH instead (-match [regex]::Escape($referenceJSONFileParentPath))