From a99314afa8bfde6003e4927c7111fa3bdf32b4df Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 22 Jun 2023 18:36:29 +0200 Subject: [PATCH] Fix backup path inquiry --- scripts/Windows/OS/Manage.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/OS/Manage.ps1 b/scripts/Windows/OS/Manage.ps1 index e78ec01f..c5ab9592 100644 --- a/scripts/Windows/OS/Manage.ps1 +++ b/scripts/Windows/OS/Manage.ps1 @@ -34,11 +34,15 @@ function Invoke-WindowsRestore([Context] $context) { { $backupPath = Read-Host -Prompt "Please enter the path to the archive load the backup from."; - if ((-not $backupPath) -or (-not (Test-Path -PathType Leaf $backupPath))) + if ($backupPath -and (-not (Test-Path -PathType Leaf $backupPath))) { Write-Host "No file could be found at the specified path."; return Read-Path; } + else + { + return $backupPath; + } } $backupPath = Read-Path;