Streamline restoration of directories

This commit is contained in:
Manuel Thalmann 2024-08-28 04:38:30 +02:00
parent fd514b1415
commit db422c45fb

View file

@ -157,7 +157,12 @@ $null = New-Module {
7z x "-o$dir" (Get-ValhallaBackupArchive) $sourcePath @ArgumentList;
if (Test-Path $filePath) {
Copy-Item -Recurse (Join-Path $dir $sourcePath) $Target;
if (Test-Path -PathType Container $filePath) {
$null = New-Item -ItemType Directory $Target -Force;
$filePath = "$filePath/*";
}
Copy-Item -Recurse $filePath $Target -Force;
}
Remove-Item -Recurse -Force $dir;