Streamline restoration of directories
This commit is contained in:
parent
a54c44be90
commit
e671592fc4
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue