2-download And Install Usbdk-1.0.22-x64.msi -

_logger.LogInfo($"Downloaded to _downloadPath"); return true; catch (HttpRequestException ex) _logger.LogError($"Download failed: ex.Message"); return false;

public void LogInfo(string message) Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine($"[INFO] DateTime.Now:HH:mm:ss - message"); Console.ResetColor();

class Program

void LogInfo(string message); void LogError(string message); void LogWarning(string message); void LogSuccess(string message);

try $webClient = New-Object System.Net.WebClient $webClient.DownloadFile($USBDK_URL, $InstallerPath) if (Test-Path $InstallerPath) Write-Log "SUCCESS" "Downloaded to $InstallerPath" return $true 2-download and install usbdk-1.0.22-x64.msi

// Step 4: Install the MSI package _logger.LogInfo("Installing USBDK..."); if (!InstallMSI()) _logger.LogError("Failed to install USBDK"); return false;

private bool IsUSBDKInstalled() try // Check if USBDK driver exists string driverPath = Path.Combine(Environment.SystemDirectory, "drivers", "UsbDk.sys"); if (File.Exists(driverPath)) return true; _logger

if ($success) Write-Log "SUCCESS" "USBDK installation completed successfully" exit 0

// Step 3: Download the installer _logger.LogInfo($"Downloading USBDK from USBDK_DOWNLOAD_URL"); if (!await DownloadInstallerAsync()) _logger.LogError("Failed to download USBDK installer"); return false; _logger.LogInfo($"Downloaded to _downloadPath")

function Install-USBDKFeature Write-Log "INFO" "Starting USBDK installation process"