From 33ed50bdf6d5c2424d83b9135d44c08ef7cf10d5 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 3 Mar 2025 11:51:01 +0100 Subject: [PATCH] Check if 7zip executable exists --- PhpManager/private/Expand-ArchiveWith7Zip.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PhpManager/private/Expand-ArchiveWith7Zip.ps1 b/PhpManager/private/Expand-ArchiveWith7Zip.ps1 index 560bf7c..3fc906c 100644 --- a/PhpManager/private/Expand-ArchiveWith7Zip.ps1 +++ b/PhpManager/private/Expand-ArchiveWith7Zip.ps1 @@ -55,6 +55,9 @@ } $sevenZipArguments += $ArchivePath $sevenZipPath = [System.IO.Path]::Combine($PSScriptRoot, 'bin', "7za-$sevenZipArchitecture.exe") + If (-Not(Test-Path -LiteralPath $sevenZipPath -PathType Leaf)) { + throw "7-Zip executable not found at $sevenZipPath" + } $sevenZipResult = & $sevenZipPath $sevenZipArguments if ($LASTEXITCODE -ne 0) { if ($createdHere) {