From e671592fc4cd211cd06c39c811c21276d44f70ee Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 28 Aug 2024 04:38:30 +0200 Subject: [PATCH] Streamline restoration of directories --- scripts/Windows/Scripts/Restoration.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Scripts/Restoration.ps1 b/scripts/Windows/Scripts/Restoration.ps1 index 5eb4d642..b915533c 100644 --- a/scripts/Windows/Scripts/Restoration.ps1 +++ b/scripts/Windows/Scripts/Restoration.ps1 @@ -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;