Show info if backup archive does not exist
This commit is contained in:
parent
9aa9ad4558
commit
9ffa903626
1 changed files with 17 additions and 7 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue