Lookup - Improve prerequisite validation

This commit is contained in:
almost.m4 2024-07-12 13:06:06 +02:00
parent 4f4811813c
commit 3abc6d8804

View File

@ -13,7 +13,8 @@ $ARCHIVE_FILE = ""
function Install-Prerequisites {
Write-Host "Checking for prerequisites..."
# Check for 7-Zip installation
if (-not (Get-Command "7z" -ErrorAction SilentlyContinue)) {
$sevenZipInstalled = Get-Command "7z" -ErrorAction SilentlyContinue
if (-not $sevenZipInstalled) {
Write-Host "7-Zip not found. Installing 7-Zip..."
Invoke-WebRequest -Uri "https://www.7-zip.org/a/7z1900-x64.msi" -OutFile "$env:TEMP\7z1900-x64.msi"
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i $env:TEMP\7z1900-x64.msi /quiet" -Wait
@ -24,7 +25,8 @@ function Install-Prerequisites {
}
# Check for hexdump installation
if (-not (Get-Command "hexdump" -ErrorAction SilentlyContinue)) {
$hexdumpInstalled = Get-Command "hexdump" -ErrorAction SilentlyContinue
if (-not $hexdumpInstalled) {
Write-Host "Hexdump not found. Installing hexdump..."
$hexdumpZipUrl = "https://www.di-mgt.com.au/src/hexdump-2.1.0.zip"
$hexdumpZipPath = "$env:TEMP\hexdump-2.1.0.zip"