finally # Cleanup: remove downloaded installer if (Test-Path $tempPath) Remove-Item $tempPath -Force Write-Host "Cleaned up temporary installer." -ForegroundColor Gray

Write-Host "Access Database Engine not found. Starting download..." -ForegroundColor Yellow try $webClient = New-Object System.Net.WebClient $webClient.DownloadFile($downloadUrl, $tempPath) Write-Host "Download completed: $tempPath" -ForegroundColor Green

if ($process.ExitCode -eq 0) Write-Host "Installation completed successfully." -ForegroundColor Green # Optional: log the installation "$(Get-Date) - Installation successful" else Out-File -FilePath $logFile -Append exit $process.ExitCode

Accessdatabaseengine_x64.exe Instant

finally # Cleanup: remove downloaded installer if (Test-Path $tempPath) Remove-Item $tempPath -Force Write-Host "Cleaned up temporary installer." -ForegroundColor Gray

Write-Host "Access Database Engine not found. Starting download..." -ForegroundColor Yellow try $webClient = New-Object System.Net.WebClient $webClient.DownloadFile($downloadUrl, $tempPath) Write-Host "Download completed: $tempPath" -ForegroundColor Green accessdatabaseengine_x64.exe

if ($process.ExitCode -eq 0) Write-Host "Installation completed successfully." -ForegroundColor Green # Optional: log the installation "$(Get-Date) - Installation successful" else Out-File -FilePath $logFile -Append exit $process.ExitCode finally # Cleanup: remove downloaded installer if (Test-Path