Show info if backup archive does not exist

This commit is contained in:
Manuel Thalmann 2023-06-30 14:15:48 +02:00
parent 45d82ddfd9
commit 2b1440c395

View file

@ -104,6 +104,15 @@ class Context {
}
[void] Restore([string]$archivePath, [string]$destinationPath) {
if (-not (Test-Path -PathType Leaf $archivePath)) {
Write-Information (
[string]::Join(
"`n",
@(
"An archive at the specified path $archivePath does not exist.",
"No restoration will be performed.")));
}
else {
if (-not (Test-Path -PathType Container $destinationPath)) {
New-Item -ItemType Directory "$destinationPath";
}
@ -114,6 +123,7 @@ class Context {
-Wait `
-NoNewWindow;
}
}
[string] GetTempDirectory() {
$tempDir = Join-Path $([System.IO.Path]::GetTempPath()) $([System.IO.Path]::GetRandomFileName());