Exporting multiple files with same name into one root folder will override them.
Current code only has temporary workaround for specific Policy exports case.
- workaround: don't multiple folder entires in config for one app which have same filenames in there root location
- fix1: check for multiple filenames beforehand -> get der parent folder name -> create subfolders in app backup location
- fix2 (simple): always create subfolders with name of last folder given in each folders entries
|
if ($appConfig.Name -eq "Policy") { |
|
$parentFolder = (Split-Path $file) -split "\\" | Select -Last 1 |
|
$newItemPath = "$Path/$($appConfig.Name)/$parentFolder/$fileName" |
|
} |