From 4f4811813cbdc8cf76b4c50b1b07884798ff2c21 Mon Sep 17 00:00:00 2001 From: "almost.m4" Date: Fri, 12 Jul 2024 12:57:05 +0200 Subject: [PATCH] Path validation --- tools/navigation_lookup_generator.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/navigation_lookup_generator.ps1 b/tools/navigation_lookup_generator.ps1 index 49fc9be..8a032ff 100644 --- a/tools/navigation_lookup_generator.ps1 +++ b/tools/navigation_lookup_generator.ps1 @@ -93,7 +93,7 @@ function Show-LookupXMLEntry { function Process-ArchiveFile { if ($ARCHIVE_FILE) { - if (Test-Path $ARCHIVE_FILE) { + if (Test-Path -Path $ARCHIVE_FILE) { if ($VERBOSE) { Write-Host "File archive exists" } $PATH_TO_INFOMAP_FILE = 7z l "$ARCHIVE_FILE" | Select-String -Pattern "$INFO_MAP_FILENAME" -NotMatch "LIGHT" | ForEach-Object { $_.Line.Split()[3] } if ($VERBOSE) { @@ -121,7 +121,7 @@ function Process-ArchiveFile { # Verifying presence of Info_Map.imp file on disk if ($VERBOSE) { Write-Host "Verifying presence of Info_Map.imp file on disk" } - if (Test-Path "/tmp/$INFO_MAP_FILENAME") { + if (Test-Path -Path "/tmp/$INFO_MAP_FILENAME") { if ($VERBOSE) { Write-Host (ls -l "/tmp/$INFO_MAP_FILENAME") } $INFOMAP_FILE = "/tmp/$INFO_MAP_FILENAME" } else { @@ -157,7 +157,7 @@ function Process-Folder { ) if ($VERBOSE) { Write-Host "Processing in folder $MapFolder ..." } - if (Test-Path "./1") { + if (Test-Path -Path "./1") { $MAP_DIR = Get-Location if ($VERBOSE) { Write-Host "We are inside Map folder: $MapFolder ... [OK]" }