Compare-IntuneBackupDirectories handling for new (added) files in DifferenceDirectory
Closed this issue · 2 comments
R3ality commented
Comparing two full backup directories while the more recent one has some items added (for example a new Intune Configuration profile has been created since the last backup) does not provide any output for the user. This may mislead user to believe nothing has changed.
Reproduction steps:
- Create full backup via
Start-IntuneBackup
(this will be theReferenceDirectory
) - Make a change in Intune which would reflect as an added (new) JSON file in the next backup (create a new device configuration profile for example)
- Create another full backup via
Start-IntuneBackup
(this will be theDifferenceDirectory
) - Run a compare via
Compare-IntuneBackupDirectories
with the above two backup directories
Proposed solution:
Referencing file "\Public\Compare-IntuneBackupDirectories.ps1"
- After looping through all files in the
$referenceFiles
variable, additionally check that no items which exist in the$differenceFiles
variable were not present. - If new files are detected, notify user in the console
- E.g.
Write-Host "ADDED FILE: Difference directory file '[FilePath]' does not exist in the reference directory."
- E.g.