Ignore inexistent backup artifacts

This commit is contained in:
Manuel Thalmann 2024-08-28 00:21:06 +02:00
parent f31eed5616
commit 4c11809c49

View file

@ -146,8 +146,13 @@ $null = New-Module {
$dir = New-TemporaryDirectory; $dir = New-TemporaryDirectory;
$sourcePath = & $pathResolver @PSBoundParameters; $sourcePath = & $pathResolver @PSBoundParameters;
$filePath = Join-Path $dir $sourcePath;
7z x "-o$dir" (Get-ValhallaBackupArchive) $sourcePath @ArgumentList; 7z x "-o$dir" (Get-ValhallaBackupArchive) $sourcePath @ArgumentList;
Copy-Item -Recurse (Join-Path $dir $sourcePath) $Target;
if (Test-Path $filePath) {
Copy-Item -Recurse (Join-Path $dir $sourcePath) $Target;
}
Remove-Item -Recurse -Force $dir; Remove-Item -Recurse -Force $dir;
} }
}; };