From ecbd0d11aba35d2e660efb57a73529d6f432d7b7 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:17:23 -0700 Subject: [PATCH 01/37] Update SystemTester.bat --- SystemTester.bat | 110 +++++++++++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 36 deletions(-) diff --git a/SystemTester.bat b/SystemTester.bat index bfaa009..8a65450 100644 --- a/SystemTester.bat +++ b/SystemTester.bat @@ -9,6 +9,7 @@ setlocal enableextensions enabledelayedexpansion :: Constants set "MIN_ZIP_SIZE=10000000" +REM ^-- Minimum expected ZIP size (~10MB) for validation set "DOWNLOAD_TIMEOUT_SEC=120" set "SCRIPT_VERSION=2.2" @@ -77,7 +78,7 @@ set "DRIVE_LETTER=%~d0" set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester.ps1" :: Check path length -for /f %%i in ('powershell -NoProfile -Command "('%SCRIPT_DIR%').Length" 2^>nul') do set "PATH_LENGTH=%%i" +for /f %%i in ('powershell -NoProfile -Command "[int](Get-Item '%~dp0').FullName.Length" 2^>nul') do set "PATH_LENGTH=%%i" if "%PATH_LENGTH%"=="" set "PATH_LENGTH=0" if %PATH_LENGTH% GTR 200 ( echo [WARNING] Path is %PATH_LENGTH% chars. Move to shorter path if errors occur. @@ -111,29 +112,21 @@ if "%PS_VERSION%"=="" ( echo PowerShell version: %PS_VERSION% echo. -:: Check for Sysinternals folder +:: Check for Sysinternals folder (FIXED: Removed duplicate) if not exist "%SCRIPT_DIR%\Sysinternals" ( echo [WARNING] Sysinternals folder not found! echo Use Menu Option 5 to download automatically. echo. timeout /t 2 >nul -) - -:: Check for PSPing specifically (for network speed tests) -if exist "%SCRIPT_DIR%\Sysinternals\psping.exe" ( - echo [INFO] PSPing detected - Full network speed tests available ) else ( - echo [INFO] PSPing not found - Basic network tests only - echo Download Sysinternals Suite for full network testing -) -echo. - -:: Check for Sysinternals folder -if not exist "%SCRIPT_DIR%\Sysinternals" ( - echo [WARNING] Sysinternals folder not found! - echo Use Menu Option 5 to download automatically. + :: Check for PSPing specifically (for network speed tests) + if exist "%SCRIPT_DIR%\Sysinternals\psping.exe" ( + echo [INFO] PSPing detected - Full network speed tests available + ) else ( + echo [INFO] PSPing not found - Basic network tests only + echo Download Sysinternals Suite for full network testing + ) echo. - timeout /t 2 >nul ) :MENU @@ -220,6 +213,11 @@ echo ======================================================== echo FIXING POWERSHELL EXECUTION POLICY echo ======================================================== echo. +echo ABOUT EXECUTION POLICY: +echo RemoteSigned allows local scripts to run without signing, +echo but requires downloaded scripts to be digitally signed. +echo This is a good balance of security and functionality. +echo. echo Current policy: powershell -NoProfile -Command "Get-ExecutionPolicy -List | Format-Table -AutoSize" echo. @@ -341,8 +339,15 @@ echo. echo -------------------------------------------------------- echo INSTALLED TOOLS: echo -------------------------------------------------------- + +:: Check GPU-Z with size validation if exist "%GPUZ_PATH%" ( - echo [OK] GPU-Z.exe - Installed + for %%A in ("%GPUZ_PATH%") do set "GPUZ_SIZE=%%~zA" + if !GPUZ_SIZE! GTR 1000000 ( + echo [OK] GPU-Z.exe - Installed ^(!GPUZ_SIZE! bytes^) + ) else ( + echo [!] GPU-Z.exe - File exists but seems corrupted ^(!GPUZ_SIZE! bytes^) + ) ) else ( echo [ ] GPU-Z.exe - Not installed ) @@ -353,12 +358,16 @@ if exist "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" ( echo [ ] NVIDIA-SMI - Not installed ^(NVIDIA GPU drivers^) ) -:: Check for AMD tools +:: Check for AMD tools (FIXED: Check multiple registry keys) set "AMD_FOUND=" -for %%R in ("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000") do ( - reg query %%R /v DriverDesc 2>nul | find /i "AMD" >nul 2>&1 - if not errorlevel 1 set "AMD_FOUND=YES" +for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s 2^>nul ^| find "HKEY_"') do ( + reg query "%%K" /v DriverDesc 2>nul | find /i "AMD" >nul 2>&1 + if not errorlevel 1 ( + set "AMD_FOUND=YES" + goto :AMD_FOUND + ) ) +:AMD_FOUND if defined AMD_FOUND ( echo [OK] AMD GPU Drivers - Installed ) else ( @@ -389,7 +398,14 @@ if exist "%GPUZ_PATH%" ( echo GPU-Z is already installed at: echo %GPUZ_PATH% echo. - for %%A in ("%GPUZ_PATH%") do echo Size: %%~zA bytes + for %%A in ("%GPUZ_PATH%") do ( + set "GPUZ_SIZE=%%~zA" + echo Size: !GPUZ_SIZE! bytes + if !GPUZ_SIZE! LSS 1000000 ( + echo [WARNING] File seems too small. May be corrupted. + echo Re-download if GPU-Z doesn't work properly. + ) + ) echo. set /p "run_gpuz=Run GPU-Z now? (Y/N): " if /i "!run_gpuz!"=="Y" ( @@ -449,7 +465,6 @@ echo ======================================================== echo. set "NVIDIA_SMI=C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" -set "NVIDIA_DRIVERS=C:\Program Files\NVIDIA Corporation" if exist "%NVIDIA_SMI%" ( echo [OK] NVIDIA System Management Interface found @@ -493,22 +508,35 @@ echo AMD TOOLS VERIFICATION echo ======================================================== echo. -:: Check for AMD GPU +:: Check for AMD GPU (FIXED: Check all registry subkeys) set "AMD_FOUND=" set "AMD_NAME=" -for /f "tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverDesc 2^>nul ^| find "DriverDesc"') do ( - set "AMD_NAME=%%b" - echo %%b | find /i "AMD" >nul 2>&1 - if not errorlevel 1 set "AMD_FOUND=YES" +set "AMD_DRIVER_VERSION=" +set "AMD_DRIVER_DATE=" + +for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s 2^>nul ^| find "HKEY_"') do ( + for /f "tokens=2*" %%a in ('reg query "%%K" /v DriverDesc 2^>nul ^| find "DriverDesc"') do ( + echo %%b | find /i "AMD" >nul 2>&1 + if not errorlevel 1 ( + set "AMD_FOUND=YES" + set "AMD_NAME=%%b" + + :: Get driver version and date + for /f "tokens=2*" %%v in ('reg query "%%K" /v DriverVersion 2^>nul ^| find "DriverVersion"') do set "AMD_DRIVER_VERSION=%%w" + for /f "tokens=2*" %%d in ('reg query "%%K" /v DriverDate 2^>nul ^| find "DriverDate"') do set "AMD_DRIVER_DATE=%%d" + goto :AMD_INFO_FOUND + ) + ) ) +:AMD_INFO_FOUND if defined AMD_FOUND ( echo [OK] AMD GPU Detected: %AMD_NAME% echo. echo AMD Driver Information: echo ======================================================== - reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverVersion 2>nul - reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverDate 2>nul + if defined AMD_DRIVER_VERSION echo Driver Version: %AMD_DRIVER_VERSION% + if defined AMD_DRIVER_DATE echo Driver Date: %AMD_DRIVER_DATE% echo ======================================================== echo. echo NOTE: AMD doesn't provide a command-line tool like @@ -602,9 +630,14 @@ echo. echo - Stress tests generate SIGNIFICANT HEAT echo - Monitor temperatures during tests echo - Ensure adequate cooling -echo - Stop if temps exceed 85C (GPU) / 95C (hotspot) +echo - Safe temps vary by GPU model - check manufacturer specs +echo - General guidance: Stop if over 85C ^(many GPUs^) +echo - Some AMD GPUs safe to 110C junction temperature echo - Laptop users: Use caution with stress tests echo. +echo ALWAYS check your specific GPU's safe temperature range +echo from the manufacturer before stress testing! +echo. echo ======================================================== echo. pause @@ -623,6 +656,7 @@ echo - Fixed memory usage calculation bug echo - Launcher awareness detection echo - Enhanced GPU testing with vendor-specific tools echo - GPU Tools Manager (Menu Option 6) +echo - Improved AMD GPU detection for multi-GPU systems echo. echo -------------------------------------------------------- echo COMMON ISSUES: @@ -645,7 +679,7 @@ echo https://download.sysinternals.com/files/SysinternalsSuite.zip echo Extract to: %SCRIPT_DIR%\Sysinternals\ echo. echo 5. MEMORY SHOWS 100%% (but Task Manager shows less) -echo This was a bug in v2.08 - FIXED in v2.1+ +echo This was a bug in earlier versions - FIXED in v2.1+ echo. echo 6. NETWORK SPEED TESTS LIMITED echo Cause: PSPing.exe not found @@ -660,21 +694,25 @@ echo - Energy Report: 15 seconds echo - Windows Update: 30-90 seconds echo - DISM/SFC: 5-15 minutes each echo. -echo 7. REPORTS NOT GENERATED +echo 8. REPORTS NOT GENERATED echo - Check write permissions echo - Ensure tests completed echo - Look for SystemTest_Clean_*.txt echo. -echo 8. PATH TOO LONG +echo 9. PATH TOO LONG echo Current: %PATH_LENGTH% characters echo Limit: 260 characters echo Solution: Move to C:\SysTest\ echo. +echo 10. AMD GPU NOT DETECTED +echo - Script now checks ALL registry subkeys +echo - Update AMD drivers if still not found +echo. echo -------------------------------------------------------- echo FEATURES: echo -------------------------------------------------------- echo. -echo NETWORK SPEED TESTING (NEW): +echo NETWORK SPEED TESTING: echo - Gateway connectivity tests echo - Internet endpoint testing (Google, Cloudflare, MS) echo - Latency measurements to multiple servers From a0cd51ab9a9c1f16c870d2de0173a4de866102f8 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:25:12 -0700 Subject: [PATCH 02/37] Update SystemTester.ps1 --- SystemTester.ps1 | 398 ++++++++++++++++++++++++++++------------------- 1 file changed, 238 insertions(+), 160 deletions(-) diff --git a/SystemTester.ps1 b/SystemTester.ps1 index fa467d4..ff83c5a 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -1,6 +1,6 @@ -# Portable Sysinternals System Tester - FINAL MERGED VERSION +# Portable Sysinternals System Tester - FIXED VERSION # Created by Pacific Northwest Computers - 2025 -# Complete Production Version - v2.2 (Merged and Debugged) +# Complete Production Version - v2.2 (Debugged) param([switch]$AutoRun) @@ -11,10 +11,9 @@ $script:ENERGY_DURATION = 20 $script:CPU_TEST_SECONDS = 30 $script:MAX_PATH_LENGTH = 240 $script:MIN_TOOL_SIZE_KB = 50 -$script:DNS_TEST_TARGETS = @("google.com", "microsoft.com", "cloudflare.com", "github.com") # Added DNS Targets +$script:DNS_TEST_TARGETS = @("google.com", "microsoft.com", "cloudflare.com", "github.com") # Paths -# Uses the more robust method for getting the script root regardless of launch method $ScriptRoot = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Path } $DriveLetter = (Split-Path -Qualifier $ScriptRoot).TrimEnd('\') $SysinternalsPath = Join-Path $ScriptRoot "Sysinternals" @@ -31,7 +30,6 @@ Write-Host "Running from: $DriveLetter" -ForegroundColor Cyan # Detect if launched via batch file function Test-LauncherAwareness { - # ... (code unchanged) try { $parentPID = (Get-Process -Id $PID).Parent.Id if ($parentPID) { @@ -49,7 +47,6 @@ function Test-LauncherAwareness { # Check admin privileges function Test-AdminPrivileges { - # ... (code unchanged) try { $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = New-Object Security.Principal.WindowsPrincipal($identity) @@ -65,65 +62,204 @@ function Test-AdminPrivileges { } } -# Tool integrity verification -function Test-ToolIntegrity { - # ... (code unchanged) - param([string]$ToolName) +# FIXED: Initialize environment +function Initialize-Environment { + Write-Host "`nInitializing environment..." -ForegroundColor Cyan - $toolPath = Join-Path $SysinternalsPath "$ToolName.exe" + Test-LauncherAwareness | Out-Null + Test-AdminPrivileges | Out-Null - # ... (rest of function logic) - try { - $signature = Get-AuthenticodeSignature $toolPath -ErrorAction Stop - - if ($signature.Status -eq "Valid") { - $subject = $signature.SignerCertificate.Subject - if ($subject -match "Microsoft Corporation") { - return @{Status="VALID_MS"; Details="Valid Microsoft signature"} - } else { - return @{Status="VALID_OTHER"; Details="Valid non-Microsoft signature: $subject"} - } - } elseif ($signature.Status -eq "NotSigned") { - return @{Status="NOT_SIGNED"; Details="File is not digitally signed"} + if ($ScriptRoot.Length -gt $script:MAX_PATH_LENGTH) { + Write-Host "WARNING: Path length ($($ScriptRoot.Length)) exceeds recommended maximum" -ForegroundColor Yellow + Write-Host " Consider moving to a shorter path like C:\SysTest\" -ForegroundColor Yellow + } + + if (!(Test-Path $SysinternalsPath)) { + Write-Host "ERROR: Sysinternals folder not found at: $SysinternalsPath" -ForegroundColor Red + Write-Host "" -ForegroundColor Red + if ($script:LaunchedViaBatch) { + Write-Host "ACTION: Return to batch launcher and use Menu Option 5 to download tools" -ForegroundColor Yellow } else { - return @{Status="BAD_SIGNATURE"; Details="Signature status: $($signature.Status)"} + Write-Host "ACTION: Download Sysinternals Suite from:" -ForegroundColor Yellow + Write-Host " https://download.sysinternals.com/files/SysinternalsSuite.zip" -ForegroundColor Yellow + Write-Host " Extract to: $SysinternalsPath" -ForegroundColor Yellow } - } catch { - return @{Status="CHECK_FAILED"; Details="Error: $($_.Exception.Message)"} + return $false } -} - - # Check for key tools - $tools = @("psinfo.exe","coreinfo.exe","pslist.exe","handle.exe","clockres.exe") + + $requiredTools = @("psinfo.exe", "coreinfo.exe", "pslist.exe", "handle.exe", "clockres.exe") $found = 0 $missing = @() - foreach ($tool in $tools) { - if (Test-Path (Join-Path $SysinternalsPath $tool)) { + + foreach ($tool in $requiredTools) { + $toolPath = Join-Path $SysinternalsPath $tool + if (Test-Path $toolPath) { $found++ } else { $missing += $tool } } - + if ($found -eq 0) { - Write-Host "ERROR: No tools found in $SysinternalsPath" -ForegroundColor Red + Write-Host "ERROR: No Sysinternals tools found in $SysinternalsPath" -ForegroundColor Red if ($script:LaunchedViaBatch) { Write-Host "ACTION: Use Batch Menu Option 5 to download tools" -ForegroundColor Yellow } return $false } - - Write-Host "Found $found/$($tools.Count) key tools" -ForegroundColor Green + + Write-Host "Environment check: $found/$($requiredTools.Count) key tools found" -ForegroundColor Green + if ($missing.Count -gt 0) { - Write-Host "Missing: $($missing -join ', ')" -ForegroundColor Yellow + Write-Host "Missing tools: $($missing -join ', ')" -ForegroundColor Yellow if ($script:LaunchedViaBatch) { - Write-Host "TIP: Use Batch Menu Option 4 for integrity check" -ForegroundColor DarkYellow + Write-Host "TIP: Use Batch Menu Option 4 to verify integrity" -ForegroundColor DarkYellow Write-Host " Use Batch Menu Option 5 to update tools" -ForegroundColor DarkYellow } } + + $pspingPath = Join-Path $SysinternalsPath "psping.exe" + if (Test-Path $pspingPath) { + Write-Host "PSPing detected - Network speed tests available" -ForegroundColor Green + } else { + Write-Host "PSPing not found - Basic network tests only" -ForegroundColor Yellow + } + + Write-Host "Environment initialized successfully" -ForegroundColor Green return $true } +# FIXED: Tool integrity verification +function Test-ToolIntegrity { + param( + [Parameter(Mandatory=$true)] + [string]$ToolName + ) + + $toolPath = Join-Path $SysinternalsPath "$ToolName.exe" + + if (!(Test-Path $toolPath)) { + return @{ + Status="NOT_FOUND" + Details="Tool not found at: $toolPath" + } + } + + $fileInfo = Get-Item $toolPath + $sizeKB = [math]::Round($fileInfo.Length / 1KB, 2) + + if ($sizeKB -lt $script:MIN_TOOL_SIZE_KB) { + return @{ + Status="SUSPICIOUS_SIZE" + Details="File size ($sizeKB KB) is suspiciously small" + } + } + + try { + $signature = Get-AuthenticodeSignature $toolPath -ErrorAction Stop + + if ($signature.Status -eq "Valid") { + $subject = $signature.SignerCertificate.Subject + if ($subject -match "Microsoft Corporation") { + return @{ + Status="VALID_MS" + Details="Valid Microsoft signature | Size: $sizeKB KB" + } + } else { + return @{ + Status="VALID_OTHER" + Details="Valid non-Microsoft signature: $subject | Size: $sizeKB KB" + } + } + } elseif ($signature.Status -eq "NotSigned") { + return @{ + Status="NOT_SIGNED" + Details="File is not digitally signed | Size: $sizeKB KB" + } + } else { + return @{ + Status="BAD_SIGNATURE" + Details="Signature status: $($signature.Status) | Size: $sizeKB KB" + } + } + } catch { + return @{ + Status="CHECK_FAILED" + Details="Error checking signature: $($_.Exception.Message)" + } + } +} + +# FIXED: Added missing function for batch launcher +function Test-ToolVerification { + Write-Host "" + Write-Host "========================================" -ForegroundColor Cyan + Write-Host " TOOL INTEGRITY VERIFICATION" -ForegroundColor Cyan + Write-Host "========================================" -ForegroundColor Cyan + Write-Host "" + + if (!(Test-Path $SysinternalsPath)) { + Write-Host "ERROR: Sysinternals folder not found: $SysinternalsPath" -ForegroundColor Red + return + } + + $tools = Get-ChildItem -Path $SysinternalsPath -Filter "*.exe" -ErrorAction SilentlyContinue + + if (!$tools) { + Write-Host "ERROR: No tools found in $SysinternalsPath" -ForegroundColor Red + return + } + + Write-Host "Checking $($tools.Count) tools..." -ForegroundColor Yellow + Write-Host "" + + $results = @{ + ValidMS = 0 + ValidOther = 0 + NotSigned = 0 + BadSignature = 0 + Failed = 0 + Suspicious = 0 + } + + foreach ($tool in $tools) { + $toolName = $tool.BaseName + $result = Test-ToolIntegrity -ToolName $toolName + + $statusColor = switch ($result.Status) { + "VALID_MS" { $results.ValidMS++; "Green" } + "VALID_OTHER" { $results.ValidOther++; "Cyan" } + "NOT_SIGNED" { $results.NotSigned++; "Yellow" } + "BAD_SIGNATURE" { $results.BadSignature++; "Red" } + "SUSPICIOUS_SIZE" { $results.Suspicious++; "Red" } + "CHECK_FAILED" { $results.Failed++; "Red" } + default { "Gray" } + } + + Write-Host ("{0,-20} : {1,-15} | {2}" -f $toolName, $result.Status, $result.Details) -ForegroundColor $statusColor + } + + Write-Host "" + Write-Host "========================================" -ForegroundColor Cyan + Write-Host "SUMMARY:" -ForegroundColor Cyan + Write-Host " Valid (Microsoft): $($results.ValidMS)" -ForegroundColor Green + Write-Host " Valid (Other): $($results.ValidOther)" -ForegroundColor Cyan + Write-Host " Not Signed: $($results.NotSigned)" -ForegroundColor Yellow + Write-Host " Bad Signature: $($results.BadSignature)" -ForegroundColor Red + Write-Host " Suspicious: $($results.Suspicious)" -ForegroundColor Red + Write-Host " Check Failed: $($results.Failed)" -ForegroundColor Red + Write-Host "========================================" -ForegroundColor Cyan + + if ($results.BadSignature -gt 0 -or $results.Suspicious -gt 0) { + Write-Host "" + Write-Host "WARNING: Some tools have issues!" -ForegroundColor Red + Write-Host "ACTION: Re-download Sysinternals Suite (Batch Menu Option 5)" -ForegroundColor Yellow + } elseif ($results.ValidMS -gt 0) { + Write-Host "" + Write-Host "All verified tools are properly signed!" -ForegroundColor Green + } +} + # Clean tool output function Clean-ToolOutput { param([string]$ToolName, [string]$RawOutput) @@ -133,11 +269,9 @@ function Clean-ToolOutput { $cleaned = @() foreach ($line in $lines) { - # Skip boilerplate if ($line -match "Copyright|Sysinternals|www\.|EULA|Mark Russinovich|David Solomon|Bryce Cogswell") { continue } if ($line -match "^-+$|^=+$|^\*+$") { continue } - # Tool-specific filtering switch ($ToolName) { "psinfo" { if ($line -match "^(System|Uptime|Kernel|Product|Service|Build|Processors|Physical|Computer|Domain|Install)") { @@ -163,7 +297,7 @@ function Clean-ToolOutput { return ($cleaned | Select-Object -First 40) -join "`n" } -# Run tool (Uses v2.2 reliable call & quotes path for spaces) +# Run tool function Run-Tool { param( [string]$ToolName, @@ -191,19 +325,13 @@ function Run-Tool { try { $start = Get-Date - # Add -accepteula for necessary tools (from v2.2 logic) if ($ToolName -in @("psinfo","pslist","handle","autorunsc","testlimit","contig","coreinfo","streams","sigcheck")) { $Args = "-accepteula $Args" } - # ARG FIX: This ensures the path is quoted to handle spaces (like in C:\Users\Jon Pienkowski) $argArray = if ($Args.Trim()) { $Args.Split(' ') | Where-Object { $_ } } else { @() } - - # *** CRITICAL FIX: Quote the executable path *** $rawOutput = & "$toolPath" $argArray 2>&1 | Out-String - $duration = ((Get-Date) - $start).TotalMilliseconds - $cleanOutput = Clean-ToolOutput -ToolName $ToolName -RawOutput $rawOutput $script:TestResults += @{ @@ -220,9 +348,6 @@ function Run-Tool { Write-Host "ERROR: $ToolName - $($_.Exception.Message)" -ForegroundColor Red } } -# ---------------------------------------------------- -# END UTILITY FUNCTIONS -# ---------------------------------------------------- # Test: System Info function Test-SystemInfo { @@ -230,7 +355,6 @@ function Test-SystemInfo { Run-Tool -ToolName "psinfo" -Args "-h -s -d" -Description "System information" Run-Tool -ToolName "clockres" -Description "Clock resolution" - # Get WMI info and store in System-Overview try { $os = Get-CimInstance Win32_OperatingSystem -ErrorAction Stop $cs = Get-CimInstance Win32_ComputerSystem -ErrorAction Stop @@ -257,7 +381,6 @@ function Test-CPU { Write-Host "`n=== CPU Testing ===" -ForegroundColor Green Run-Tool -ToolName "coreinfo" -Args "-v -f -c" -Description "CPU architecture" - # Get WMI CPU details try { $cpu = Get-CimInstance Win32_Processor -ErrorAction Stop | Select-Object -First 1 $info = @" @@ -277,11 +400,9 @@ L3 Cache: $($cpu.L3CacheSize) KB Write-Host "Error getting CPU details" -ForegroundColor Yellow } - # Run remaining CPU-related tools Run-Tool -ToolName "pslist" -Args "-t" -Description "Process tree snapshot" Run-Tool -ToolName "handle" -Args "-p explorer" -Description "Explorer handles" - # CPU stress test Write-Host "Running CPU test ($script:CPU_TEST_SECONDS sec - synthetic)..." -ForegroundColor Yellow try { $start = Get-Date @@ -303,17 +424,14 @@ L3 Cache: $($cpu.L3CacheSize) KB } } -# Test: Memory (FIXED) +# Test: Memory function Test-Memory { Write-Host "`n=== RAM Testing ===" -ForegroundColor Green try { $mem = Get-CimInstance Win32_ComputerSystem -ErrorAction Stop $os = Get-CimInstance Win32_OperatingSystem -ErrorAction Stop $totalGB = [math]::Round($mem.TotalPhysicalMemory/1GB,2) - - # FIX: FreePhysicalMemory is in KB, convert to GB correctly $availGB = [math]::Round($os.FreePhysicalMemory/1024/1024,2) - $usedGB = $totalGB - $availGB $usage = [math]::Round(($usedGB/$totalGB)*100,1) @@ -357,7 +475,6 @@ function Test-Storage { Run-Tool -ToolName "du" -Args "-l 2 C:\" -Description "Disk usage C:" - # Disk performance test Write-Host "Running disk test..." -ForegroundColor Yellow try { $testFile = Join-Path $env:TEMP "disktest_$([guid]::NewGuid().ToString('N')).tmp" @@ -448,7 +565,7 @@ function Test-OSHealth { } } -# Test: SMART +# FIXED: Test-StorageSMART (removed wrong DISM/SFC code) function Test-StorageSMART { Write-Host "`n=== Storage SMART ===" -ForegroundColor Green try { @@ -461,17 +578,6 @@ function Test-StorageSMART { } catch {} if (-not $lines) { $lines = @("SMART data not available (driver limitation)") } - - Write-Host "Running DISM and SFC (may take 5-15 min)..." -ForegroundColor Yellow - try { - $start = Get-Date - # DISM - Write-Host " Running DISM..." -ForegroundColor Yellow - $dismResult = DISM /Online /Cleanup-Image /CheckHealth 2>&1 | Out-String - # SFC - Write-Host " Running SFC..." -ForegroundColor Yellow - $sfcResult = sfc /scannow 2>&1 | Out-String - $duration = ((Get-Date) - $start).TotalMilliseconds $script:TestResults += @{ Tool="Storage-SMART"; Description="SMART data" @@ -483,7 +589,7 @@ function Test-StorageSMART { } } -# Test: TRIM +# FIXED: Test-Trim (corrected output message) function Test-Trim { Write-Host "`n=== SSD TRIM Status ===" -ForegroundColor Green try { @@ -502,7 +608,7 @@ function Test-Trim { Tool="SSD-TRIM"; Description="TRIM status" Status="SUCCESS"; Output=($txt -join "`n"); Duration=50 } - Write-Host "SMART data collected" -ForegroundColor Green + Write-Host "TRIM status collected" -ForegroundColor Green } catch { Write-Host "TRIM check failed" -ForegroundColor Yellow } @@ -528,11 +634,10 @@ function Test-NIC { } } -# Test: GPU (Enhanced) +# Test: GPU function Test-GPU { Write-Host "`n=== GPU Testing (Enhanced) ===" -ForegroundColor Green - # Part 1: Detailed WMI/CIM GPU Information Write-Host "Gathering GPU details..." -ForegroundColor Yellow try { $gpus = Get-CimInstance Win32_VideoController -ErrorAction Stop @@ -576,7 +681,6 @@ function Test-GPU { Write-Host "Error getting GPU details: $($_.Exception.Message)" -ForegroundColor Yellow } - # Part 2: Display Configuration Write-Host "Analyzing display configuration..." -ForegroundColor Yellow try { $monitors = Get-CimInstance WmiMonitorID -Namespace root\wmi -ErrorAction Stop @@ -590,19 +694,16 @@ function Test-GPU { $displayInfo += "Display #$index" $displayInfo += "-" * 40 - # Decode manufacturer name if ($monitor.ManufacturerName) { $mfg = [System.Text.Encoding]::ASCII.GetString($monitor.ManufacturerName -ne 0) $displayInfo += "Manufacturer: $mfg" } - # Decode product name if ($monitor.UserFriendlyName) { $name = [System.Text.Encoding]::ASCII.GetString($monitor.UserFriendlyName -ne 0) $displayInfo += "Model: $name" } - # Decode serial number if ($monitor.SerialNumberID) { $serial = [System.Text.Encoding]::ASCII.GetString($monitor.SerialNumberID -ne 0) $displayInfo += "Serial: $serial" @@ -622,7 +723,6 @@ function Test-GPU { Write-Host "Display configuration unavailable" -ForegroundColor Yellow } - # Part 3: GPU Driver Details (Enhanced) Write-Host "Checking GPU drivers..." -ForegroundColor Yellow try { $drivers = Get-CimInstance Win32_PnPSignedDriver -ErrorAction Stop | @@ -648,7 +748,6 @@ function Test-GPU { Write-Host "Driver details unavailable" -ForegroundColor Yellow } - # Part 4: DirectX Diagnostics (Enhanced) Write-Host "Running DirectX diagnostics..." -ForegroundColor Yellow $dxProcess = $null try { @@ -668,15 +767,12 @@ function Test-GPU { $raw = Get-Content $dx -Raw -ErrorAction Stop Remove-Item $dx -ErrorAction SilentlyContinue - # Extract more detailed info $dxInfo = @() - # DirectX version if ($raw -match "DirectX Version: (.+)") { $dxInfo += "DirectX Version: $($matches[1])" } - # Display devices section $lines = $raw -split "`r?`n" $inDisplaySection = $false $displayLines = @() @@ -717,7 +813,6 @@ function Test-GPU { } } - # Part 5: OpenGL Information Write-Host "Checking OpenGL support..." -ForegroundColor Yellow try { $openglInfo = @() @@ -744,25 +839,21 @@ function Test-GPU { Write-Host "OpenGL check skipped" -ForegroundColor DarkGray } - # Part 6: GPU Performance Capabilities Write-Host "Checking GPU capabilities..." -ForegroundColor Yellow try { $capabilities = @() - # Check for hardware acceleration $dwm = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\Dwm" -ErrorAction SilentlyContinue if ($dwm) { $capabilities += "DWM Composition: Enabled" } - # Check for GPU scheduling $gpuScheduling = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -ErrorAction SilentlyContinue if ($gpuScheduling.HwSchMode) { $schedStatus = if ($gpuScheduling.HwSchMode -eq 2) { "Enabled" } else { "Disabled" } $capabilities += "Hardware-Accelerated GPU Scheduling: $schedStatus" } - # Check DirectX feature levels $gpus = Get-CimInstance Win32_VideoController foreach ($gpu in $gpus) { if ($gpu.Name) { @@ -791,11 +882,10 @@ function Test-GPU { } } -# Test: Vendor-Specific GPU Testing (NVIDIA/AMD) +# FIXED: Test-GPUVendorSpecific (AMD detection now checks all registry keys) function Test-GPUVendorSpecific { Write-Host "`n=== Vendor-Specific GPU Testing ===" -ForegroundColor Green - # Check for NVIDIA try { $nvidiaSmi = "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" if (Test-Path $nvidiaSmi) { @@ -810,7 +900,6 @@ function Test-GPUVendorSpecific { Write-Host "NVIDIA metrics collected" -ForegroundColor Green - # Get more detailed info $detailedOutput = & $nvidiaSmi -q 2>&1 | Out-String $script:TestResults += @{ @@ -829,35 +918,48 @@ function Test-GPUVendorSpecific { Write-Host "NVIDIA test failed: $($_.Exception.Message)" -ForegroundColor Yellow } - # Check for AMD try { - $amdRegistry = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" + $videoControllerPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" - if (Test-Path $amdRegistry) { - $amdInfo = Get-ItemProperty $amdRegistry -ErrorAction Stop - + if (Test-Path $videoControllerPath) { + $amdFound = $false $amdOutput = @() - $amdOutput += "AMD GPU Detected" - $amdOutput += "Driver Description: $($amdInfo.DriverDesc)" - $amdOutput += "Driver Version: $($amdInfo.DriverVersion)" - $amdOutput += "Driver Date: $($amdInfo.DriverDate)" + $amdOutput += "AMD GPU Detection Results:" + $amdOutput += "" - if ($amdInfo.DriverDesc -match "AMD|Radeon") { + Get-ChildItem $videoControllerPath -ErrorAction Stop | ForEach-Object { + try { + $props = Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue + if ($props.DriverDesc -match "AMD|Radeon") { + $amdFound = $true + $amdOutput += "Device Found:" + $amdOutput += " Driver Description: $($props.DriverDesc)" + $amdOutput += " Driver Version: $($props.DriverVersion)" + $amdOutput += " Driver Date: $($props.DriverDate)" + $amdOutput += " Registry Key: $($_.PSChildName)" + $amdOutput += "" + } + } catch {} + } + + if ($amdFound) { $script:TestResults += @{ Tool="AMD-GPU"; Description="AMD GPU information" Status="SUCCESS"; Output=($amdOutput -join "`n"); Duration=100 } Write-Host "AMD GPU information collected" -ForegroundColor Green + } else { + Write-Host "AMD GPU not detected" -ForegroundColor DarkGray + $script:TestResults += @{ + Tool="AMD-GPU"; Description="AMD GPU information" + Status="SKIPPED"; Output="No AMD GPU detected in registry"; Duration=0 + } } } else { - Write-Host "AMD GPU not detected" -ForegroundColor DarkGray - $script:TestResults += @{ - Tool="AMD-GPU"; Description="AMD GPU information" - Status="SKIPPED"; Output="No AMD GPU detected"; Duration=0 - } + Write-Host "Video controller registry path not found" -ForegroundColor DarkGray } } catch { - Write-Host "AMD GPU check unavailable" -ForegroundColor DarkGray + Write-Host "AMD GPU check error: $($_.Exception.Message)" -ForegroundColor Yellow } } @@ -873,7 +975,6 @@ function Test-GPUMemory { Write-Host "Testing $($gpu.Name) - $totalRAM GB VRAM" -ForegroundColor Yellow - # Get current usage via performance counters (if available) try { $perfCounters = Get-Counter -Counter "\GPU Engine(*)\Running Time" -ErrorAction Stop @@ -889,7 +990,6 @@ function Test-GPUMemory { Write-Host "GPU memory test complete" -ForegroundColor Green } catch { - # Fallback to basic info $usage = @() $usage += "GPU: $($gpu.Name)" $usage += "Total VRAM: $totalRAM GB" @@ -972,10 +1072,13 @@ function Test-HardwareEvents { } } -# Test: Windows Update +# FIXED: Test-WindowsUpdate (improved COM cleanup) function Test-WindowsUpdate { Write-Host "`n=== Windows Update ===" -ForegroundColor Green $updateSession = $null + $searcher = $null + $result = $null + try { $lines = @() try { @@ -1004,19 +1107,25 @@ function Test-WindowsUpdate { } catch { Write-Host "Windows Update check failed" -ForegroundColor Yellow } finally { + if ($result) { + try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($result) | Out-Null } catch {} + } + if ($searcher) { + try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($searcher) | Out-Null } catch {} + } if ($updateSession) { try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($updateSession) | Out-Null } catch {} } [System.GC]::Collect() + [System.GC]::WaitForPendingFinalizers() + [System.GC]::Collect() } } -# Generate Dual Reports (Clean + Detailed) - ENHANCED VERSION -# Replace the entire Generate-Report function in SystemTester.ps1 (around line 1260) +# Generate Reports function Generate-Report { Write-Host "`nGenerating reports..." -ForegroundColor Cyan - # Test write access $testFile = Join-Path $ScriptRoot "writetest_$([guid]::NewGuid().ToString('N')).tmp" try { "test" | Out-File -FilePath $testFile -ErrorAction Stop @@ -1030,14 +1139,12 @@ function Generate-Report { $cleanPath = Join-Path $ScriptRoot "SystemTest_Clean_$timestamp.txt" $detailedPath = Join-Path $ScriptRoot "SystemTest_Detailed_$timestamp.txt" - # Calculate stats $success = ($TestResults | Where-Object {$_.Status -eq "SUCCESS"}).Count $failed = ($TestResults | Where-Object {$_.Status -eq "FAILED"}).Count $skipped = ($TestResults | Where-Object {$_.Status -eq "SKIPPED"}).Count $total = $TestResults.Count $successRate = if ($total -gt 0) { [math]::Round(($success/$total)*100,1) } else { 0 } - # === CLEAN REPORT === $cleanReport = @() $cleanReport += "=========================================" $cleanReport += " SYSTEM TEST REPORT v$script:VERSION" @@ -1059,7 +1166,6 @@ function Generate-Report { $cleanReport += "KEY FINDINGS:" $cleanReport += "-------------" - # Extract key info from results $sysInfo = $TestResults | Where-Object {$_.Tool -eq "System-Overview"} if ($sysInfo) { $cleanReport += "" @@ -1085,26 +1191,21 @@ function Generate-Report { if ($gpuDetails -and $gpuDetails.Output -match "GPU #1") { $cleanReport += "" $cleanReport += "GPU:" - # Extract just the first GPU's name $gpuLines = $gpuDetails.Output -split "`n" foreach ($line in $gpuLines) { if ($line -match "Name:|Adapter RAM:|Driver Version:") { $cleanReport += " $line" } - if ($line -match "GPU #2") { break } # Stop at second GPU + if ($line -match "GPU #2") { break } } } - # ======================================== - # ENHANCED RECOMMENDATIONS ENGINE - # ======================================== $cleanReport += "" $cleanReport += "RECOMMENDATIONS:" $cleanReport += "----------------" $recommendations = @() - # === MEMORY ANALYSIS === if ($ramInfo -and $ramInfo.Output -match "Usage: ([\d\.]+)%") { $usage = [float]$matches[1] if ($usage -gt 85) { @@ -1120,13 +1221,7 @@ function Generate-Report { $recommendations += "• GOOD: Low memory usage ($usage%) - plenty of RAM available" } } - - # --- 5. RECOMMENDATIONS ENGINE --- - $cleanReport += "" - $cleanReport += "RECOMMENDATIONS:" - $cleanReport += "----------------" - # === STORAGE HEALTH === $smartInfo = $TestResults | Where-Object {$_.Tool -eq "Storage-SMART"} if ($smartInfo -and $smartInfo.Output -notmatch "not available") { if ($smartInfo.Output -match "Warning|Caution|Failed|Degraded") { @@ -1137,12 +1232,10 @@ function Generate-Report { } } - # === STORAGE PERFORMANCE === if ($diskPerf -and $diskPerf.Output -match "Write: ([\d\.]+) MB/s.*Read: ([\d\.]+) MB/s") { $writeSpeed = [float]$matches[1] $readSpeed = [float]$matches[2] - # HDD typical: 80-160 MB/s, SSD typical: 200-550 MB/s (SATA), NVMe: 1500+ MB/s if ($writeSpeed -lt 50 -or $readSpeed -lt 50) { $recommendations += "• WARNING: Very slow disk performance detected" $recommendations += " → Write: $writeSpeed MB/s, Read: $readSpeed MB/s" @@ -1157,7 +1250,6 @@ function Generate-Report { } } - # === STORAGE CAPACITY === $storageInfo = $TestResults | Where-Object {$_.Tool -eq "Storage-Overview"} if ($storageInfo) { $drives = $storageInfo.Output -split "`n" | Where-Object {$_ -match "([A-Z]:).*\((\d+)%\)"} @@ -1181,7 +1273,6 @@ function Generate-Report { } } - # === SSD TRIM STATUS === $trimInfo = $TestResults | Where-Object {$_.Tool -eq "SSD-TRIM"} if ($trimInfo -and $trimInfo.Output -match "Disabled") { $recommendations += "• WARNING: TRIM is disabled for SSD" @@ -1189,7 +1280,6 @@ function Generate-Report { $recommendations += " → TRIM maintains SSD performance and longevity" } - # === NETWORK PERFORMANCE === $nicInfo = $TestResults | Where-Object {$_.Tool -eq "NIC-Info"} if ($nicInfo) { if ($nicInfo.Output -match "10 Mbps|100 Mbps") { @@ -1206,7 +1296,6 @@ function Generate-Report { } } - # === WINDOWS UPDATE === $updateInfo = $TestResults | Where-Object {$_.Tool -eq "Windows-Update"} if ($updateInfo) { if ($updateInfo.Output -match "Pending: (\d+)") { @@ -1231,7 +1320,6 @@ function Generate-Report { } } - # === OS HEALTH (DISM/SFC) === $osHealth = $TestResults | Where-Object {$_.Tool -eq "OS-Health"} if ($osHealth -and $osHealth.Status -eq "SUCCESS") { if ($osHealth.Output -match "corrupt|error|repairable") { @@ -1242,7 +1330,6 @@ function Generate-Report { } } - # === HARDWARE ERRORS (WHEA) === $wheaInfo = $TestResults | Where-Object {$_.Tool -eq "WHEA"} if ($wheaInfo -and $wheaInfo.Output -notmatch "No WHEA errors") { $recommendations += "• WARNING: Hardware errors detected in event log" @@ -1252,7 +1339,6 @@ function Generate-Report { $recommendations += " → Check for overheating issues" } - # === CPU PERFORMANCE === $cpuPerf = $TestResults | Where-Object {$_.Tool -eq "CPU-Performance"} if ($cpuPerf -and $cpuPerf.Output -match "Ops/sec: (\d+)") { $opsPerSec = [int]$matches[1] @@ -1265,21 +1351,22 @@ function Generate-Report { } } - # === GPU HEALTH === + # FIXED: Added try/catch for GPU driver year parsing if ($gpuDetails) { if ($gpuDetails.Output -match "Driver Date:.*(\d{4})") { - $driverYear = [int]$matches[1] - $currentYear = (Get-Date).Year - if ($currentYear - $driverYear -gt 1) { - $recommendations += "• INFO: GPU drivers are over 1 year old" - $recommendations += " → Update to latest drivers for best performance" - $recommendations += " → NVIDIA: GeForce Experience or nvidia.com" - $recommendations += " → AMD: amd.com/en/support" - } + try { + $driverYear = [int]$matches[1] + $currentYear = (Get-Date).Year + if ($currentYear - $driverYear -gt 1) { + $recommendations += "• INFO: GPU drivers are over 1 year old ($driverYear)" + $recommendations += " → Update to latest drivers for best performance" + $recommendations += " → NVIDIA: GeForce Experience or nvidia.com" + $recommendations += " → AMD: amd.com/en/support" + } + } catch {} } } - # === BATTERY HEALTH (Laptops) === $powerInfo = $TestResults | Where-Object {$_.Tool -eq "Power-Energy"} if ($powerInfo -and $powerInfo.Output -match "Battery") { if ($powerInfo.Output -match "energy-report.html") { @@ -1288,7 +1375,6 @@ function Generate-Report { } } - # === OVERALL SYSTEM HEALTH === if ($failed -gt 5) { $recommendations += "• CRITICAL: Multiple test failures ($failed failures)" $recommendations += " → Review detailed report for specific issues" @@ -1303,7 +1389,6 @@ function Generate-Report { $recommendations += " → Run as administrator for complete diagnostics" } - # === GENERAL MAINTENANCE === if ($recommendations.Count -lt 3) { $recommendations += "" $recommendations += "GENERAL MAINTENANCE TIPS:" @@ -1314,7 +1399,6 @@ function Generate-Report { $recommendations += "• Back up important data regularly" } - # Add all recommendations to report foreach ($rec in $recommendations) { $cleanReport += $rec } @@ -1323,7 +1407,6 @@ function Generate-Report { $cleanReport += "For detailed output, see: $detailedPath" $cleanReport += "" - # === DETAILED REPORT === $detailedReport = @() $detailedReport += "=========================================" $detailedReport += " SYSTEM TEST REPORT v$script:VERSION" @@ -1354,7 +1437,6 @@ function Generate-Report { $detailedReport += "-" * 80 } - # Save reports try { $cleanReport | Out-File -FilePath $cleanPath -Encoding UTF8 $detailedReport | Out-File -FilePath $detailedPath -Encoding UTF8 @@ -1437,24 +1519,20 @@ function Start-Menu { "10" { Test-Trim; Read-Host "`nPress Enter" } "11" { Test-NIC; Read-Host "`nPress Enter" } "12" { - # Run all GPU tests when "12" is selected Test-GPU Test-GPUVendorSpecific Test-GPUMemory Read-Host "`nPress Enter" } "12a" { - # Basic GPU info only Test-GPU Read-Host "`nPress Enter" } "12b" { - # Vendor-specific only Test-GPUVendorSpecific Read-Host "`nPress Enter" } "12c" { - # GPU memory test only Test-GPUMemory Read-Host "`nPress Enter" } @@ -1466,7 +1544,7 @@ function Start-Menu { Test-SystemInfo; Test-CPU; Test-Memory; Test-Storage Test-Processes; Test-Security; Test-Network; Test-OSHealth Test-StorageSMART; Test-Trim; Test-NIC - Test-GPU; Test-GPUVendorSpecific; Test-GPUMemory # All GPU tests + Test-GPU; Test-GPUVendorSpecific; Test-GPUMemory Test-Power; Test-HardwareEvents; Test-WindowsUpdate Write-Host "`nAll tests complete!" -ForegroundColor Green Read-Host "Press Enter" @@ -1480,7 +1558,7 @@ function Start-Menu { } while ($choice -ne "Q" -and $choice -ne "q") } -# Main - only execute if script is run directly (not dot-sourced) +# Main if ($MyInvocation.InvocationName -ne '.') { try { Write-Host "Starting Sysinternals Tester v$script:VERSION..." -ForegroundColor Green From 0b13bc5b479ae01cd691713d02e23b5398ba1684 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:31:43 -0700 Subject: [PATCH 03/37] Update SystemTester.bat --- SystemTester.bat | 115 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 30 deletions(-) diff --git a/SystemTester.bat b/SystemTester.bat index 8a65450..02a6e45 100644 --- a/SystemTester.bat +++ b/SystemTester.bat @@ -4,12 +4,11 @@ setlocal enableextensions enabledelayedexpansion :: ===================================================== :: Portable Sysinternals System Tester Launcher :: Created by Pacific Northwest Computers - 2025 -:: Production Ready Version - v2.2 +:: Production Ready Version - v2.2 (FIXED) :: ===================================================== :: Constants set "MIN_ZIP_SIZE=10000000" -REM ^-- Minimum expected ZIP size (~10MB) for validation set "DOWNLOAD_TIMEOUT_SEC=120" set "SCRIPT_VERSION=2.2" @@ -49,7 +48,7 @@ echo. powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList '/elevated' -Verb RunAs" -if errorlevel 1 ( +if %errorlevel% neq 0 ( echo [ERROR] Failed to elevate. Run manually as administrator. pause ) @@ -61,7 +60,7 @@ color 0B :: Change to script directory cd /d "%~dp0" 2>nul -if errorlevel 1 ( +if %errorlevel% neq 0 ( echo [ERROR] Cannot access directory: %~dp0 pause exit /b 1 @@ -112,7 +111,7 @@ if "%PS_VERSION%"=="" ( echo PowerShell version: %PS_VERSION% echo. -:: Check for Sysinternals folder (FIXED: Removed duplicate) +:: FIXED: Check for Sysinternals folder (removed duplicate) if not exist "%SCRIPT_DIR%\Sysinternals" ( echo [WARNING] Sysinternals folder not found! echo Use Menu Option 5 to download automatically. @@ -176,7 +175,7 @@ echo. pause powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_PS1%" echo. -if errorlevel 1 ( +if %errorlevel% neq 0 ( echo [ERROR] Script failed (code: %errorlevel%) pause ) else ( @@ -198,7 +197,7 @@ pause echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_PS1%" -AutoRun echo. -if errorlevel 1 ( +if %errorlevel% neq 0 ( echo [ERROR] Tests failed (code: %errorlevel%) pause ) else ( @@ -266,7 +265,7 @@ echo. echo Downloading... powershell -NoProfile -ExecutionPolicy Bypass -Command "$ProgressPreference='SilentlyContinue'; try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri '%DOWNLOAD_URL%' -OutFile '%ZIP_FILE%' -TimeoutSec %DOWNLOAD_TIMEOUT_SEC%; Write-Host 'Download complete' -ForegroundColor Green } catch { Write-Host ('ERROR: ' + $_.Exception.Message) -ForegroundColor Red; exit 1 }" -if errorlevel 1 ( +if %errorlevel% neq 0 ( echo. echo Download failed. Check internet connection. if exist "%ZIP_FILE%" del "%ZIP_FILE%" 2>nul @@ -340,13 +339,14 @@ echo -------------------------------------------------------- echo INSTALLED TOOLS: echo -------------------------------------------------------- -:: Check GPU-Z with size validation +:: FIXED: Check GPU-Z with size validation if exist "%GPUZ_PATH%" ( for %%A in ("%GPUZ_PATH%") do set "GPUZ_SIZE=%%~zA" if !GPUZ_SIZE! GTR 1000000 ( echo [OK] GPU-Z.exe - Installed ^(!GPUZ_SIZE! bytes^) ) else ( echo [!] GPU-Z.exe - File exists but seems corrupted ^(!GPUZ_SIZE! bytes^) + echo Expected size: ^>1MB. Re-download recommended. ) ) else ( echo [ ] GPU-Z.exe - Not installed @@ -358,7 +358,7 @@ if exist "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" ( echo [ ] NVIDIA-SMI - Not installed ^(NVIDIA GPU drivers^) ) -:: Check for AMD tools (FIXED: Check multiple registry keys) +:: FIXED: Check for AMD tools (check ALL registry subkeys) set "AMD_FOUND=" for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s 2^>nul ^| find "HKEY_"') do ( reg query "%%K" /v DriverDesc 2>nul | find /i "AMD" >nul 2>&1 @@ -366,6 +366,11 @@ for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Clas set "AMD_FOUND=YES" goto :AMD_FOUND ) + reg query "%%K" /v DriverDesc 2>nul | find /i "Radeon" >nul 2>&1 + if not errorlevel 1 ( + set "AMD_FOUND=YES" + goto :AMD_FOUND + ) ) :AMD_FOUND if defined AMD_FOUND ( @@ -403,7 +408,10 @@ if exist "%GPUZ_PATH%" ( echo Size: !GPUZ_SIZE! bytes if !GPUZ_SIZE! LSS 1000000 ( echo [WARNING] File seems too small. May be corrupted. + echo Expected size: ^>1MB echo Re-download if GPU-Z doesn't work properly. + ) else ( + echo [OK] File size looks good ) ) echo. @@ -429,7 +437,7 @@ echo. echo Creating Tools directory... if not exist "%GPU_TOOLS_DIR%" ( mkdir "%GPU_TOOLS_DIR%" 2>nul - if errorlevel 1 ( + if %errorlevel% neq 0 ( echo [ERROR] Cannot create directory: %GPU_TOOLS_DIR% pause goto GPU_TOOLS @@ -450,6 +458,7 @@ echo 2. Save it to: %GPU_TOOLS_DIR% echo 3. Rename it to: GPU-Z.exe echo. echo Full path should be: %GPUZ_PATH% +echo Expected file size: 5-10 MB echo. echo NOTE: TechPowerUp doesn't provide direct download links, echo so manual download is required. @@ -508,35 +517,69 @@ echo AMD TOOLS VERIFICATION echo ======================================================== echo. -:: Check for AMD GPU (FIXED: Check all registry subkeys) +:: FIXED: Check for AMD GPU (check ALL registry subkeys) set "AMD_FOUND=" set "AMD_NAME=" set "AMD_DRIVER_VERSION=" set "AMD_DRIVER_DATE=" +set "AMD_COUNT=0" + +echo Scanning for AMD GPUs in all registry locations... +echo. for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s 2^>nul ^| find "HKEY_"') do ( for /f "tokens=2*" %%a in ('reg query "%%K" /v DriverDesc 2^>nul ^| find "DriverDesc"') do ( echo %%b | find /i "AMD" >nul 2>&1 if not errorlevel 1 ( set "AMD_FOUND=YES" - set "AMD_NAME=%%b" + set /a AMD_COUNT+=1 + + echo [AMD GPU #!AMD_COUNT!] + echo Device: %%b + + :: Get driver version + for /f "tokens=2*" %%v in ('reg query "%%K" /v DriverVersion 2^>nul ^| find "DriverVersion"') do ( + echo Driver Version: %%w + ) - :: Get driver version and date - for /f "tokens=2*" %%v in ('reg query "%%K" /v DriverVersion 2^>nul ^| find "DriverVersion"') do set "AMD_DRIVER_VERSION=%%w" - for /f "tokens=2*" %%d in ('reg query "%%K" /v DriverDate 2^>nul ^| find "DriverDate"') do set "AMD_DRIVER_DATE=%%d" - goto :AMD_INFO_FOUND + :: Get driver date + for /f "tokens=2*" %%d in ('reg query "%%K" /v DriverDate 2^>nul ^| find "DriverDate"') do ( + echo Driver Date: %%d + ) + + :: Get registry key location + echo Registry Key: %%K + echo. + ) else ( + echo %%b | find /i "Radeon" >nul 2>&1 + if not errorlevel 1 ( + set "AMD_FOUND=YES" + set /a AMD_COUNT+=1 + + echo [AMD GPU #!AMD_COUNT!] + echo Device: %%b + + :: Get driver version + for /f "tokens=2*" %%v in ('reg query "%%K" /v DriverVersion 2^>nul ^| find "DriverVersion"') do ( + echo Driver Version: %%w + ) + + :: Get driver date + for /f "tokens=2*" %%d in ('reg query "%%K" /v DriverDate 2^>nul ^| find "DriverDate"') do ( + echo Driver Date: %%d + ) + + :: Get registry key location + echo Registry Key: %%K + echo. + ) ) ) ) -:AMD_INFO_FOUND if defined AMD_FOUND ( - echo [OK] AMD GPU Detected: %AMD_NAME% - echo. - echo AMD Driver Information: echo ======================================================== - if defined AMD_DRIVER_VERSION echo Driver Version: %AMD_DRIVER_VERSION% - if defined AMD_DRIVER_DATE echo Driver Date: %AMD_DRIVER_DATE% + echo Total AMD GPUs detected: %AMD_COUNT% echo ======================================================== echo. echo NOTE: AMD doesn't provide a command-line tool like @@ -554,6 +597,7 @@ if defined AMD_FOUND ( echo If you have an AMD GPU but it's not detected: echo 1. Update AMD drivers from: https://www.amd.com/en/support echo 2. Use AMD Auto-Detect tool + echo 3. Check Device Manager for display adapters echo. echo If you don't have an AMD GPU, this is normal. ) @@ -649,14 +693,17 @@ echo ======================================================== echo HELP / TROUBLESHOOTING GUIDE v%SCRIPT_VERSION% echo ======================================================== echo. -echo NEW IN v2.2: +echo NEW IN v2.2 (FIXED): echo - Tool integrity verification (digital signatures) echo - Dual report system (Clean + Detailed) echo - Fixed memory usage calculation bug echo - Launcher awareness detection echo - Enhanced GPU testing with vendor-specific tools echo - GPU Tools Manager (Menu Option 6) -echo - Improved AMD GPU detection for multi-GPU systems +echo - FIXED: AMD GPU detection now checks ALL registry keys +echo - FIXED: GPU-Z size validation added +echo - FIXED: Removed duplicate Sysinternals check +echo - FIXED: Consistent errorlevel checking echo. echo -------------------------------------------------------- echo COMMON ISSUES: @@ -688,9 +735,9 @@ echo PSPing enables: Bandwidth testing, TCP latency echo. echo 7. TESTS TAKE TOO LONG echo Expected durations: -echo - CPU Test: 10 seconds -echo - Network Speed: 30-60 seconds -echo - Energy Report: 15 seconds +echo - CPU Test: 30 seconds +echo - Disk Test: 10-30 seconds +echo - Energy Report: 20 seconds (configurable) echo - Windows Update: 30-90 seconds echo - DISM/SFC: 5-15 minutes each echo. @@ -705,8 +752,16 @@ echo Limit: 260 characters echo Solution: Move to C:\SysTest\ echo. echo 10. AMD GPU NOT DETECTED -echo - Script now checks ALL registry subkeys -echo - Update AMD drivers if still not found +echo FIXED: Script now checks ALL registry subkeys +echo If still not detected: +echo - Update AMD drivers +echo - Check Device Manager +echo - Verify GPU is enabled +echo. +echo 11. GPU-Z FILE CORRUPTED +echo FIXED: Script now validates file size +echo Expected: 5-10 MB +echo If corrupted, re-download from TechPowerUp echo. echo -------------------------------------------------------- echo FEATURES: From c143549478b40a1aa01085c66e12d57ac30af19c Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:37:27 -0700 Subject: [PATCH 04/37] Update README.md --- README.md | 239 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 192 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index d0840e1..1d6f5ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🧰 Portable Sysinternals System Tester v2.2 +# 🧰 Portable Sysinternals System Tester v2.2 (FIXED) **Thumb-drive friendly, no-install Windows hardware health check toolkit** powered by **Sysinternals** and **PowerShell**. @@ -11,9 +11,19 @@ A zero-dependency **PowerShell solution** that runs a comprehensive, curated set --- -## 🚀 NEW in v2.2: Advanced Network Speed & Latency Testing +## ⚠️ IMPORTANT: Use the FIXED Version -Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) for in-depth connectivity and performance analysis, integrated directly into the clean reporting system. +**Version 2.2 has been debugged and all critical bugs have been fixed.** Use the files marked `_FIXED` for proper operation: +- `SystemTester_FIXED.ps1` - PowerShell script +- `SystemTester_FIXED.bat` - Batch launcher + +The original v2.2 files contained critical bugs that prevented execution. These have been resolved in the fixed versions. + +--- + +## 🚀 NEW in v2.2: Enhanced GPU Testing & Critical Bug Fixes + +Version 2.2 introduces comprehensive GPU testing capabilities and fixes several critical bugs that prevented the script from running properly. ### Key New Capabilities: @@ -21,6 +31,7 @@ Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) f * 🧹 **Output Cleaner** — removes banners, EULA text, usage blocks for readable reports * 🧠 **Comprehensive Tests** — CPU, RAM, Disk, GPU, Network, OS Health, Windows Update status * 🎮 **Enhanced GPU Testing** — Multi-GPU support, NVIDIA/AMD vendor tools, display configuration +* 🔧 **Tool Integrity Verification** — Digital signature checking for Sysinternals tools * 🗂️ **Smart Reporting** — timestamped **Summary** + **Detailed** TXT reports with actionable recommendations * 📦 **Fully Portable** — run from USB; no installation required * 🧰 **Graceful Degradation** — missing tools detected and skipped automatically with helpful messages @@ -28,7 +39,47 @@ Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) f * 📥 **Auto-Download Tools** — built-in Sysinternals Suite downloader (no manual setup needed!) * 🔄 **Windows Update Integration** — checks pending updates, history, and service status * ⚡ **Modern PowerShell** — uses CIM instances (not deprecated WMI) for better performance -* 🛡️ **Tool Integrity Verification** — digital signature checking for Sysinternals tools + +--- + +## 🐛 Critical Bug Fixes in v2.2 + +### PowerShell Script Fixes + +| Issue | Impact | Status | +|-------|--------|--------| +| **Missing `Initialize-Environment` function** | 🔴 **CRITICAL** - Script crashed on startup | ✅ Fixed | +| **Broken `Test-ToolIntegrity` function** | 🔴 Tool verification failed | ✅ Fixed | +| **Missing `Test-ToolVerification` function** | 🟡 Batch menu option 4 crashed | ✅ Fixed | +| **Wrong DISM/SFC code in SMART test** | 🟡 SMART test ran wrong operations | ✅ Fixed | +| **Incorrect TRIM output message** | 🟢 Cosmetic only | ✅ Fixed | +| **AMD GPU detection limited to registry \0000** | 🟡 Multi-GPU AMD systems not detected | ✅ Fixed | +| **GPU driver year parsing could crash** | 🟢 Rare crash in recommendations | ✅ Fixed | +| **COM object memory leak in Windows Update** | 🟢 Minor memory leak | ✅ Fixed | + +### Batch Launcher Fixes + +| Issue | Impact | Status | +|-------|--------|--------| +| **Duplicate Sysinternals folder check** | 🟢 Annoying duplicate warnings | ✅ Fixed | +| **AMD GPU detection limited to \0000** | 🟡 Multi-GPU AMD systems not detected | ✅ Fixed | +| **No GPU-Z size validation** | 🟢 Corrupted files not caught | ✅ Fixed | +| **Inconsistent errorlevel checking** | 🟢 Minor reliability issues | ✅ Fixed | + +### Impact Summary + +**Before Fixes:** +- ❌ PowerShell script would crash immediately on startup +- ❌ Tool verification from batch menu would fail +- ⚠️ AMD GPUs only detected if in first registry position +- ⚠️ SMART test would incorrectly run DISM/SFC scans + +**After Fixes:** +- ✅ Script runs reliably from startup +- ✅ All menu options functional +- ✅ Multi-GPU systems fully supported +- ✅ All tests run correct operations +- ✅ Better error handling throughout --- @@ -47,8 +98,8 @@ Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) f ``` 📂 SystemTester/ -├── 📄 SystemTester.ps1 # Main PowerShell script -├── 📄 SystemTester.bat # Batch launcher (recommended) +├── 📄 SystemTester_FIXED.ps1 # Main PowerShell script (USE THIS) +├── 📄 SystemTester_FIXED.bat # Batch launcher (USE THIS) ├── 📄 README.md # This file ├── 📄 LICENSE # MIT License ├── 📂 Sysinternals/ # Auto-created by launcher @@ -72,7 +123,7 @@ Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) f ### Option A: Batch Launcher (Recommended) 1. Download or clone this repository -2. Run `SystemTester.bat` (will request admin elevation) +2. Run `SystemTester_FIXED.bat` (will request admin elevation) 3. Choose **Option 5** to auto-download Sysinternals Suite (first time only) 4. Choose **Option 6** to set up GPU testing tools (optional) 5. Choose **Option 1** for interactive menu or **Option 2** to run all tests @@ -82,10 +133,10 @@ Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) f ```powershell # Interactive menu -powershell -ExecutionPolicy Bypass -File .\SystemTester.ps1 +powershell -ExecutionPolicy Bypass -File .\SystemTester_FIXED.ps1 # Run all tests automatically -powershell -ExecutionPolicy Bypass -File .\SystemTester.ps1 -AutoRun +powershell -ExecutionPolicy Bypass -File .\SystemTester_FIXED.ps1 -AutoRun ``` ### **First-Time Setup** @@ -107,16 +158,16 @@ For enhanced GPU testing: |---|----------|-------------|----------------| | 1 | **System Information** | OS details, computer info, clock resolution | `psinfo`, `clockres`, CIM queries | | 2 | **CPU Testing** | Architecture, performance benchmarks, top processes | `coreinfo`, stress test, process analysis | -| 3 | **RAM Testing** | Memory capacity, modules, usage patterns | CIM queries, `testlimit`, performance counters | -| 4 | **Storage Testing** | Drives, fragmentation, performance, SMART data | `du`, `contig`, `streams`, read/write tests | +| 3 | **RAM Testing** | Memory capacity, modules, usage patterns | CIM queries, performance counters | +| 4 | **Storage Testing** | Drives, fragmentation, performance, SMART data | `du`, read/write tests | | 5 | **Process Analysis** | Running processes, handles, process tree | `pslist`, `handle` | | 6 | **Security Analysis** | Autorun entries, startup items | `autorunsc` | -| 7 | **FULL Network Analysis** | Active connections, adapter info | `netstat`, `Get-NetAdapter`, `psping`,`Test-NetConncetion` | +| 7 | **Network Analysis** | Active connections, adapter info | `netstat`, `Get-NetAdapter` | | 8 | **OS Health** | System file integrity, component store | `DISM`, `SFC` | -| 9 | **Storage SMART** | Drive health, reliability counters | `Get-PhysicalDisk`, WMI SMART | +| 9 | **Storage SMART** | Drive health, reliability counters | `Get-PhysicalDisk` | | 10 | **SSD TRIM** | TRIM enablement status | `fsutil` | -| 11 | **Network Adapters** | Link status, speed, IP addresses | `Get-NetAdapter`, `Get-NetIPConfiguration` | -| 12 | **GPU (Enhanced)** | Multi-GPU info, vendor tools, memory | CIM, `dxdiag`, `nvidia-smi`, GPU-Z | +| 11 | **Network Adapters** | Link status, speed, MAC addresses | `Get-NetAdapter` | +| 12 | **GPU (Enhanced)** | Multi-GPU info, vendor tools, memory | CIM, `dxdiag`, `nvidia-smi` | | 12a | **Basic GPU Info** | Details, displays, drivers, DirectX, OpenGL | CIM queries, `dxdiag` | | 12b | **Vendor-Specific** | NVIDIA/AMD metrics, temperatures, utilization | `nvidia-smi`, AMD registry | | 12c | **GPU Memory** | VRAM capacity, usage, performance counters | CIM, performance counters | @@ -131,7 +182,7 @@ For enhanced GPU testing: ### Clean Summary Report ``` ========================================= - SYSTEM TEST REPORT v2.1 + SYSTEM TEST REPORT v2.2 CLEAN SUMMARY ========================================= Date: 2025-01-03 14:30:22 @@ -174,9 +225,10 @@ GPU: RECOMMENDATIONS: ---------------- • GOOD: Low memory usage (42.2%) - plenty of RAM available -• INFO: GPU drivers are over 1 year old +• INFO: GPU drivers are over 1 year old (2023) → Update to latest drivers for best performance → NVIDIA: GeForce Experience or nvidia.com + → AMD: amd.com/en/support • WARNING: 15 pending Windows Updates → Install updates soon for security and stability → Schedule during non-working hours @@ -190,17 +242,17 @@ For detailed output, see: SystemTest_Detailed_20250103_143022.txt ## 🔧 Launcher Menu Options -The batch launcher (`SystemTester.bat`) provides: +The batch launcher (`SystemTester_FIXED.bat`) provides: 1. **Run Interactive Menu** — Select individual tests (includes GPU sub-options) 2. **Run ALL Tests Automatically** — Complete system scan with auto-report 3. **Fix PowerShell Execution Policy** — Set CurrentUser to RemoteSigned -4. **Verify Tool Integrity** — Check digital signatures and file sizes +4. **Verify Tool Integrity** — Check digital signatures and file sizes (FIXED: now works!) 5. **Download/Update Sysinternals Suite** — Auto-download from Microsoft (~35 MB) -6. **GPU Testing Tools Manager** — **NEW!** Download and manage GPU testing tools - - GPU-Z installation assistant +6. **GPU Testing Tools Manager** — Download and manage GPU testing tools + - GPU-Z installation assistant (with size validation) - NVIDIA tools verification (nvidia-smi) - - AMD driver detection + - AMD driver detection (multi-GPU support) - Tool recommendations (FurMark, 3DMark, etc.) 7. **Help / Troubleshooting** — Comprehensive troubleshooting guide 8. **Exit** — Close launcher @@ -210,7 +262,7 @@ The batch launcher (`SystemTester.bat`) provides: When you select GPU testing in the PowerShell menu, you can: * **12** - Run all GPU tests (comprehensive) * **12a** - Basic GPU info only (fastest, ~3-5 seconds) -* **12b** - Vendor-specific tools (NVIDIA-SMI, AMD) +* **12b** - Vendor-specific tools (NVIDIA-SMI, AMD - now detects all GPUs) * **12c** - GPU memory testing --- @@ -226,6 +278,21 @@ When you select GPU testing in the PowerShell menu, you can: ### "Access denied" / Permission errors **Solution:** Right-click launcher and choose "Run as administrator" +### Script crashes immediately on startup (v2.2 original only) +**Solution:** ✅ **FIXED** - Use `SystemTester_FIXED.ps1` instead. Original had missing `Initialize-Environment` function. + +### Tool verification (Menu Option 4) crashes +**Solution:** ✅ **FIXED** - Use `SystemTester_FIXED.bat` and `SystemTester_FIXED.ps1`. Missing function has been added. + +### AMD GPU not detected (multi-GPU systems) +**Solution:** ✅ **FIXED** - Script now checks ALL registry subkeys (\0000, \0001, \0002, etc.), not just \0000. + +### GPU-Z appears corrupted +**Solution:** ✅ **FIXED** - Launcher now validates file size (should be >1MB). Re-download if size is too small. + +### SMART test runs DISM/SFC instead +**Solution:** ✅ **FIXED** - Incorrect code has been removed from SMART test function. + ### Windows Update check fails **Solution:** Ensure Windows Update service is running; may require administrator rights @@ -235,14 +302,15 @@ When you select GPU testing in the PowerShell menu, you can: - For AMD: Install latest drivers from amd.com/support - nvidia-smi is included with NVIDIA drivers - Some GPU tests don't require special tools and should always work +- **Note:** AMD detection now properly checks all registry locations ### Tests taking too long **Expected:** Some tests are intentionally slow: -- CPU Performance: 10 seconds -- Power/Energy Report: 15 seconds (admin only) +- CPU Performance: 30 seconds +- Power/Energy Report: 20 seconds (admin only) - Windows Update Search: 30-90 seconds - DISM/SFC Scans: 5-15 minutes each (admin only) -- DirectX Diagnostics (dxdiag): Up to 45 seconds +- DirectX Diagnostics (dxdiag): Up to 50 seconds --- @@ -254,21 +322,44 @@ When you select GPU testing in the PowerShell menu, you can: * **No Telemetry:** Script does not send data anywhere; purely local operation * **Auto-Download:** Only downloads from official Microsoft servers (download.sysinternals.com) * **GPU Tools:** GPU-Z must be downloaded manually from techpowerup.com (launcher opens browser) +* **File Validation:** Tool integrity verification checks digital signatures and file sizes --- ## 📋 What's New in Version 2.2 -### Key New Capabilities: +### Major New Features | Feature | Description | | :--- | :--- | -| **Local Connectivity** | Tests local network, default gateway reachability (`Test-NetConnection`). | -| **Internet Reachability** | Connectivity tests to multiple endpoints (Google DNS, Cloudflare DNS, Google.com, Microsoft.com). Includes port-specific testing (DNS 53, HTTPS 443). | -| **Latency Testing** | Detailed ping tests to multiple targets with round-trip time measurements. | -| **PSPing Integration** | Advanced latency and TCP bandwidth capacity testing for connection quality analysis (requires `psping.exe` in Sysinternals folder). | -| **DNS Resolution Speed** | Measures DNS lookup speed for multiple domains in milliseconds. | -| **Network MTU Discovery** | Checks for standard MTU (1500 bytes) without fragmentation to help identify network configuration issues. | +| **Tool Integrity Verification** | Check digital signatures and validate file sizes of Sysinternals tools | +| **Enhanced GPU Testing** | Multi-GPU support, vendor-specific tools (NVIDIA/AMD), display configuration | +| **GPU Tools Manager** | New batch menu option for managing GPU testing utilities | +| **Dual Report System** | Clean summary + detailed output in separate timestamped files | +| **Launcher Awareness** | Script detects if launched via batch file for better guidance | + +### Critical Bug Fixes + +| Fix | Description | +| :--- | :--- | +| **Initialize-Environment** | Added missing function - script now starts properly | +| **Tool Verification** | Fixed broken integrity checking - Menu Option 4 now works | +| **AMD Multi-GPU** | Now detects AMD GPUs in any registry position, not just \0000 | +| **SMART Test** | Removed incorrect DISM/SFC code - runs proper SMART checks | +| **GPU-Z Validation** | Added size checking to detect corrupted downloads | +| **COM Cleanup** | Improved memory management in Windows Update test | +| **TRIM Message** | Fixed incorrect output message (was "SMART data collected") | +| **Driver Year Parsing** | Added error handling to prevent crashes in recommendations | +| **Duplicate Checks** | Removed redundant Sysinternals folder validation | +| **ErrorLevel Consistency** | Standardized error checking in batch file | + +### Improvements + +* Better error messages throughout +* More robust path handling for spaces in usernames +* Enhanced recommendations engine with more actionable advice +* Improved GPU driver age detection with fallback handling +* Better COM object lifecycle management --- @@ -279,9 +370,10 @@ When you select GPU testing in the PowerShell menu, you can: * Baseline comparison mode (compare current vs. previous tests) * Skip flags (`-SkipCPU`, `-SkipNetwork`, etc.) * CSV export for data analysis -* Network throughput testing +* Network throughput testing (PSPing integration) * Memory leak detection * Audio device testing +* Intel Arc GPU support ### Version 3.0 (Long-term) * WPF/WinUI graphical interface option @@ -313,9 +405,10 @@ When you select GPU testing in the PowerShell menu, you can: - Temperature, utilization, memory usage - Power draw, clock speeds - Full detailed GPU query -- **AMD:** Registry-based driver detection +- **AMD:** Registry-based driver detection (✅ FIXED: Multi-GPU support) - Driver version and date - GPU identification + - Detects GPUs in any registry position **GPU Memory (Option 12c):** - Total VRAM capacity @@ -324,13 +417,13 @@ When you select GPU testing in the PowerShell menu, you can: ### GPU Tool Requirements -| Tool | Required For | Included With | -|------|--------------|---------------| -| CIM/WMI | Basic info | Windows (always available) | -| dxdiag | DirectX info | Windows (always available) | -| nvidia-smi | NVIDIA metrics | NVIDIA drivers | -| Registry | AMD detection | Windows (always available) | -| GPU-Z | Advanced monitoring | Manual download (optional) | +| Tool | Required For | Included With | Status | +|------|--------------|---------------|--------| +| CIM/WMI | Basic info | Windows (always available) | ✅ Always works | +| dxdiag | DirectX info | Windows (always available) | ✅ Always works | +| nvidia-smi | NVIDIA metrics | NVIDIA drivers | Optional | +| Registry | AMD detection | Windows (always available) | ✅ Fixed for multi-GPU | +| GPU-Z | Advanced monitoring | Manual download (optional) | ✅ Size validated | ### GPU Stress Testing (Optional) @@ -348,6 +441,7 @@ The launcher's GPU Tools Manager (Option 6) provides recommendations for: Contributions welcome! Areas of interest: +* **Bug Reports:** Test the fixed version and report any remaining issues * **Parsers:** New tool output cleaners * **Tests:** Additional diagnostic modules (audio, peripherals, temperatures) * **GPU Tools:** Additional vendor integrations (Intel Arc, etc.) @@ -360,9 +454,20 @@ Contributions welcome! Areas of interest: 1. Open an issue to discuss large changes 2. Follow existing code style and patterns 3. Test on Windows 10 and Windows 11 -4. Test with multiple GPU types if possible -5. Update README and help text -6. Run PSScriptAnalyzer if possible +4. Test with multiple GPU types if possible (NVIDIA, AMD, integrated) +5. Test on multi-GPU systems if available +6. Update README and help text +7. Run PSScriptAnalyzer if possible + +**Testing Checklist:** +- [ ] Single GPU system (NVIDIA/AMD/Intel) +- [ ] Multi-GPU system (if available) +- [ ] Paths with spaces in username +- [ ] Non-admin execution +- [ ] Admin execution +- [ ] Missing Sysinternals tools +- [ ] Menu Option 4 (Tool Verification) +- [ ] Menu Option 6 (GPU Tools Manager) --- @@ -400,7 +505,7 @@ For security vulnerabilities or sensitive findings: **Please include:** * Detailed reproduction steps -* Affected versions +* Affected versions (specify if original v2.2 or FIXED version) * Potential impact assessment * Suggested remediation (if any) @@ -410,10 +515,18 @@ For security vulnerabilities or sensitive findings: * **Documentation Issues:** Open a GitHub issue * **Feature Requests:** Start a GitHub discussion +* **Bug Reports:** Open a GitHub issue (specify which version you're using) * **General Questions:** Check the Help section in launcher (Option 7) * **GPU Testing Help:** See GPU Tools Manager (Batch Menu Option 6) * **Commercial Support:** Contact support@pnwcomputers.com +**When reporting issues, please specify:** +- Which version you're using (original v2.2 or FIXED version) +- Operating System (Windows 10/11, build number) +- GPU type (NVIDIA/AMD/Intel, model) +- Whether you're running as administrator +- Complete error message (if applicable) + --- ## 🙏 Acknowledgments @@ -424,7 +537,39 @@ For security vulnerabilities or sensitive findings: * **TechPowerUp** - For GPU-Z, an excellent GPU monitoring tool * **PowerShell Community** - For modules, patterns, and best practices * **Contributors** - Everyone who has reported issues, suggested features, or contributed code +* **Beta Testers** - For finding the critical bugs that led to the FIXED release --- -**Last Updated:** January 2025 | **Version:** 2.1 | **Status:** Production Ready +## 📝 Version History + +### v2.2 (FIXED) - January 2025 +- ✅ Fixed critical startup crash (missing Initialize-Environment) +- ✅ Fixed tool verification (Menu Option 4) +- ✅ Fixed AMD multi-GPU detection +- ✅ Fixed SMART test running wrong operations +- ✅ Added GPU-Z size validation +- ✅ Improved error handling throughout +- ✅ Fixed memory leak in Windows Update test + +### v2.2 (Original) - January 2025 +- ⚠️ Known issues - use FIXED version instead +- Added GPU testing enhancements +- Added tool integrity verification +- Added dual report system + +### v2.1 - December 2024 +- Fixed memory usage calculation bug +- Added recommendations engine +- Improved report formatting + +### v2.0 - November 2024 +- Complete rewrite with modular functions +- Added interactive menu system +- Added batch launcher + +--- + +**Last Updated:** January 2025 | **Version:** 2.2 (FIXED) | **Status:** Production Ready + +**⚠️ IMPORTANT:** Always use the `_FIXED` versions of the files for proper operation. From 0535583a50f460d63b4e7764b9052bfb50a4237e Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:39:33 -0700 Subject: [PATCH 05/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d6f5ca..a638564 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🧰 Portable Sysinternals System Tester v2.2 (FIXED) +# 🧰 Portable Sysinternals System Tester v2.2 (FIX IN PROGRESS) **Thumb-drive friendly, no-install Windows hardware health check toolkit** powered by **Sysinternals** and **PowerShell**. From cd8478b5cdf54cbf4f9ab85dee7fdce1d91961f3 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:39:44 -0700 Subject: [PATCH 06/37] Update README.md --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index a638564..630fada 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,6 @@ A zero-dependency **PowerShell solution** that runs a comprehensive, curated set --- -## ⚠️ IMPORTANT: Use the FIXED Version - -**Version 2.2 has been debugged and all critical bugs have been fixed.** Use the files marked `_FIXED` for proper operation: -- `SystemTester_FIXED.ps1` - PowerShell script -- `SystemTester_FIXED.bat` - Batch launcher - -The original v2.2 files contained critical bugs that prevented execution. These have been resolved in the fixed versions. - ---- - ## 🚀 NEW in v2.2: Enhanced GPU Testing & Critical Bug Fixes Version 2.2 introduces comprehensive GPU testing capabilities and fixes several critical bugs that prevented the script from running properly. From 130f0c80e23e048abfc996e2adddc7faac41d23d Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:44:23 -0700 Subject: [PATCH 07/37] Update SystemTester.bat --- SystemTester.bat | 211 +++++++++-------------------------------------- 1 file changed, 41 insertions(+), 170 deletions(-) diff --git a/SystemTester.bat b/SystemTester.bat index 02a6e45..5489d6f 100644 --- a/SystemTester.bat +++ b/SystemTester.bat @@ -4,7 +4,7 @@ setlocal enableextensions enabledelayedexpansion :: ===================================================== :: Portable Sysinternals System Tester Launcher :: Created by Pacific Northwest Computers - 2025 -:: Production Ready Version - v2.2 (FIXED) +:: Production Ready Version - v2.2 :: ===================================================== :: Constants @@ -48,7 +48,7 @@ echo. powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList '/elevated' -Verb RunAs" -if %errorlevel% neq 0 ( +if errorlevel 1 ( echo [ERROR] Failed to elevate. Run manually as administrator. pause ) @@ -60,7 +60,7 @@ color 0B :: Change to script directory cd /d "%~dp0" 2>nul -if %errorlevel% neq 0 ( +if errorlevel 1 ( echo [ERROR] Cannot access directory: %~dp0 pause exit /b 1 @@ -77,7 +77,7 @@ set "DRIVE_LETTER=%~d0" set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester.ps1" :: Check path length -for /f %%i in ('powershell -NoProfile -Command "[int](Get-Item '%~dp0').FullName.Length" 2^>nul') do set "PATH_LENGTH=%%i" +for /f %%i in ('powershell -NoProfile -Command "('%SCRIPT_DIR%').Length" 2^>nul') do set "PATH_LENGTH=%%i" if "%PATH_LENGTH%"=="" set "PATH_LENGTH=0" if %PATH_LENGTH% GTR 200 ( echo [WARNING] Path is %PATH_LENGTH% chars. Move to shorter path if errors occur. @@ -111,21 +111,12 @@ if "%PS_VERSION%"=="" ( echo PowerShell version: %PS_VERSION% echo. -:: FIXED: Check for Sysinternals folder (removed duplicate) +:: Check for Sysinternals folder if not exist "%SCRIPT_DIR%\Sysinternals" ( echo [WARNING] Sysinternals folder not found! echo Use Menu Option 5 to download automatically. echo. timeout /t 2 >nul -) else ( - :: Check for PSPing specifically (for network speed tests) - if exist "%SCRIPT_DIR%\Sysinternals\psping.exe" ( - echo [INFO] PSPing detected - Full network speed tests available - ) else ( - echo [INFO] PSPing not found - Basic network tests only - echo Download Sysinternals Suite for full network testing - ) - echo. ) :MENU @@ -175,7 +166,7 @@ echo. pause powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_PS1%" echo. -if %errorlevel% neq 0 ( +if errorlevel 1 ( echo [ERROR] Script failed (code: %errorlevel%) pause ) else ( @@ -197,7 +188,7 @@ pause echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_PS1%" -AutoRun echo. -if %errorlevel% neq 0 ( +if errorlevel 1 ( echo [ERROR] Tests failed (code: %errorlevel%) pause ) else ( @@ -212,11 +203,6 @@ echo ======================================================== echo FIXING POWERSHELL EXECUTION POLICY echo ======================================================== echo. -echo ABOUT EXECUTION POLICY: -echo RemoteSigned allows local scripts to run without signing, -echo but requires downloaded scripts to be digitally signed. -echo This is a good balance of security and functionality. -echo. echo Current policy: powershell -NoProfile -Command "Get-ExecutionPolicy -List | Format-Table -AutoSize" echo. @@ -256,8 +242,6 @@ set "DOWNLOAD_URL=https://download.sysinternals.com/files/SysinternalsSuite.zip" echo This will download ~35MB from Microsoft. echo Target: %SYSINT_DIR% echo. -echo NOTE: Includes PSPing for advanced network speed testing -echo. set /p "confirm=Proceed? (Y/N): " if /i not "%confirm%"=="Y" goto MENU @@ -265,7 +249,7 @@ echo. echo Downloading... powershell -NoProfile -ExecutionPolicy Bypass -Command "$ProgressPreference='SilentlyContinue'; try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri '%DOWNLOAD_URL%' -OutFile '%ZIP_FILE%' -TimeoutSec %DOWNLOAD_TIMEOUT_SEC%; Write-Host 'Download complete' -ForegroundColor Green } catch { Write-Host ('ERROR: ' + $_.Exception.Message) -ForegroundColor Red; exit 1 }" -if %errorlevel% neq 0 ( +if errorlevel 1 ( echo. echo Download failed. Check internet connection. if exist "%ZIP_FILE%" del "%ZIP_FILE%" 2>nul @@ -298,15 +282,6 @@ echo. set "TOOL_COUNT=0" for %%F in ("%SYSINT_DIR%\*.exe") do set /a TOOL_COUNT+=1 echo [SUCCESS] %TOOL_COUNT% tools installed in %SYSINT_DIR% -echo. - -:: Check specifically for PSPing -if exist "%SYSINT_DIR%\psping.exe" ( - echo [SUCCESS] PSPing installed - Network speed tests enabled! -) else ( - echo [WARNING] PSPing not found - Basic network tests only -) - echo. echo TIP: Use Menu Option 4 to verify tool integrity echo. @@ -338,16 +313,8 @@ echo. echo -------------------------------------------------------- echo INSTALLED TOOLS: echo -------------------------------------------------------- - -:: FIXED: Check GPU-Z with size validation if exist "%GPUZ_PATH%" ( - for %%A in ("%GPUZ_PATH%") do set "GPUZ_SIZE=%%~zA" - if !GPUZ_SIZE! GTR 1000000 ( - echo [OK] GPU-Z.exe - Installed ^(!GPUZ_SIZE! bytes^) - ) else ( - echo [!] GPU-Z.exe - File exists but seems corrupted ^(!GPUZ_SIZE! bytes^) - echo Expected size: ^>1MB. Re-download recommended. - ) + echo [OK] GPU-Z.exe - Installed ) else ( echo [ ] GPU-Z.exe - Not installed ) @@ -358,21 +325,12 @@ if exist "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" ( echo [ ] NVIDIA-SMI - Not installed ^(NVIDIA GPU drivers^) ) -:: FIXED: Check for AMD tools (check ALL registry subkeys) +:: Check for AMD tools set "AMD_FOUND=" -for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s 2^>nul ^| find "HKEY_"') do ( - reg query "%%K" /v DriverDesc 2>nul | find /i "AMD" >nul 2>&1 - if not errorlevel 1 ( - set "AMD_FOUND=YES" - goto :AMD_FOUND - ) - reg query "%%K" /v DriverDesc 2>nul | find /i "Radeon" >nul 2>&1 - if not errorlevel 1 ( - set "AMD_FOUND=YES" - goto :AMD_FOUND - ) +for %%R in ("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000") do ( + reg query %%R /v DriverDesc 2>nul | find /i "AMD" >nul 2>&1 + if not errorlevel 1 set "AMD_FOUND=YES" ) -:AMD_FOUND if defined AMD_FOUND ( echo [OK] AMD GPU Drivers - Installed ) else ( @@ -403,17 +361,7 @@ if exist "%GPUZ_PATH%" ( echo GPU-Z is already installed at: echo %GPUZ_PATH% echo. - for %%A in ("%GPUZ_PATH%") do ( - set "GPUZ_SIZE=%%~zA" - echo Size: !GPUZ_SIZE! bytes - if !GPUZ_SIZE! LSS 1000000 ( - echo [WARNING] File seems too small. May be corrupted. - echo Expected size: ^>1MB - echo Re-download if GPU-Z doesn't work properly. - ) else ( - echo [OK] File size looks good - ) - ) + for %%A in ("%GPUZ_PATH%") do echo Size: %%~zA bytes echo. set /p "run_gpuz=Run GPU-Z now? (Y/N): " if /i "!run_gpuz!"=="Y" ( @@ -437,7 +385,7 @@ echo. echo Creating Tools directory... if not exist "%GPU_TOOLS_DIR%" ( mkdir "%GPU_TOOLS_DIR%" 2>nul - if %errorlevel% neq 0 ( + if errorlevel 1 ( echo [ERROR] Cannot create directory: %GPU_TOOLS_DIR% pause goto GPU_TOOLS @@ -458,7 +406,6 @@ echo 2. Save it to: %GPU_TOOLS_DIR% echo 3. Rename it to: GPU-Z.exe echo. echo Full path should be: %GPUZ_PATH% -echo Expected file size: 5-10 MB echo. echo NOTE: TechPowerUp doesn't provide direct download links, echo so manual download is required. @@ -474,6 +421,7 @@ echo ======================================================== echo. set "NVIDIA_SMI=C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" +set "NVIDIA_DRIVERS=C:\Program Files\NVIDIA Corporation" if exist "%NVIDIA_SMI%" ( echo [OK] NVIDIA System Management Interface found @@ -517,69 +465,22 @@ echo AMD TOOLS VERIFICATION echo ======================================================== echo. -:: FIXED: Check for AMD GPU (check ALL registry subkeys) +:: Check for AMD GPU set "AMD_FOUND=" set "AMD_NAME=" -set "AMD_DRIVER_VERSION=" -set "AMD_DRIVER_DATE=" -set "AMD_COUNT=0" - -echo Scanning for AMD GPUs in all registry locations... -echo. - -for /f "tokens=*" %%K in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s 2^>nul ^| find "HKEY_"') do ( - for /f "tokens=2*" %%a in ('reg query "%%K" /v DriverDesc 2^>nul ^| find "DriverDesc"') do ( - echo %%b | find /i "AMD" >nul 2>&1 - if not errorlevel 1 ( - set "AMD_FOUND=YES" - set /a AMD_COUNT+=1 - - echo [AMD GPU #!AMD_COUNT!] - echo Device: %%b - - :: Get driver version - for /f "tokens=2*" %%v in ('reg query "%%K" /v DriverVersion 2^>nul ^| find "DriverVersion"') do ( - echo Driver Version: %%w - ) - - :: Get driver date - for /f "tokens=2*" %%d in ('reg query "%%K" /v DriverDate 2^>nul ^| find "DriverDate"') do ( - echo Driver Date: %%d - ) - - :: Get registry key location - echo Registry Key: %%K - echo. - ) else ( - echo %%b | find /i "Radeon" >nul 2>&1 - if not errorlevel 1 ( - set "AMD_FOUND=YES" - set /a AMD_COUNT+=1 - - echo [AMD GPU #!AMD_COUNT!] - echo Device: %%b - - :: Get driver version - for /f "tokens=2*" %%v in ('reg query "%%K" /v DriverVersion 2^>nul ^| find "DriverVersion"') do ( - echo Driver Version: %%w - ) - - :: Get driver date - for /f "tokens=2*" %%d in ('reg query "%%K" /v DriverDate 2^>nul ^| find "DriverDate"') do ( - echo Driver Date: %%d - ) - - :: Get registry key location - echo Registry Key: %%K - echo. - ) - ) - ) +for /f "tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverDesc 2^>nul ^| find "DriverDesc"') do ( + set "AMD_NAME=%%b" + echo %%b | find /i "AMD" >nul 2>&1 + if not errorlevel 1 set "AMD_FOUND=YES" ) if defined AMD_FOUND ( + echo [OK] AMD GPU Detected: %AMD_NAME% + echo. + echo AMD Driver Information: echo ======================================================== - echo Total AMD GPUs detected: %AMD_COUNT% + reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverVersion 2>nul + reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverDate 2>nul echo ======================================================== echo. echo NOTE: AMD doesn't provide a command-line tool like @@ -597,7 +498,6 @@ if defined AMD_FOUND ( echo If you have an AMD GPU but it's not detected: echo 1. Update AMD drivers from: https://www.amd.com/en/support echo 2. Use AMD Auto-Detect tool - echo 3. Check Device Manager for display adapters echo. echo If you don't have an AMD GPU, this is normal. ) @@ -674,14 +574,9 @@ echo. echo - Stress tests generate SIGNIFICANT HEAT echo - Monitor temperatures during tests echo - Ensure adequate cooling -echo - Safe temps vary by GPU model - check manufacturer specs -echo - General guidance: Stop if over 85C ^(many GPUs^) -echo - Some AMD GPUs safe to 110C junction temperature +echo - Stop if temps exceed 85C (GPU) / 95C (hotspot) echo - Laptop users: Use caution with stress tests echo. -echo ALWAYS check your specific GPU's safe temperature range -echo from the manufacturer before stress testing! -echo. echo ======================================================== echo. pause @@ -693,17 +588,13 @@ echo ======================================================== echo HELP / TROUBLESHOOTING GUIDE v%SCRIPT_VERSION% echo ======================================================== echo. -echo NEW IN v2.2 (FIXED): +echo NEW IN v2.2: echo - Tool integrity verification (digital signatures) echo - Dual report system (Clean + Detailed) echo - Fixed memory usage calculation bug echo - Launcher awareness detection echo - Enhanced GPU testing with vendor-specific tools echo - GPU Tools Manager (Menu Option 6) -echo - FIXED: AMD GPU detection now checks ALL registry keys -echo - FIXED: GPU-Z size validation added -echo - FIXED: Removed duplicate Sysinternals check -echo - FIXED: Consistent errorlevel checking echo. echo -------------------------------------------------------- echo COMMON ISSUES: @@ -726,55 +617,29 @@ echo https://download.sysinternals.com/files/SysinternalsSuite.zip echo Extract to: %SCRIPT_DIR%\Sysinternals\ echo. echo 5. MEMORY SHOWS 100%% (but Task Manager shows less) -echo This was a bug in earlier versions - FIXED in v2.1+ +echo This was a bug in v2.08 - FIXED in v2.2 echo. -echo 6. NETWORK SPEED TESTS LIMITED -echo Cause: PSPing.exe not found -echo Solution: Download Sysinternals Suite (Option 5) -echo PSPing enables: Bandwidth testing, TCP latency -echo. -echo 7. TESTS TAKE TOO LONG +echo 6. TESTS TAKE TOO LONG echo Expected durations: -echo - CPU Test: 30 seconds -echo - Disk Test: 10-30 seconds -echo - Energy Report: 20 seconds (configurable) +echo - CPU Test: 10 seconds +echo - Energy Report: 15 seconds echo - Windows Update: 30-90 seconds echo - DISM/SFC: 5-15 minutes each echo. -echo 8. REPORTS NOT GENERATED +echo 7. REPORTS NOT GENERATED echo - Check write permissions echo - Ensure tests completed echo - Look for SystemTest_Clean_*.txt echo. -echo 9. PATH TOO LONG +echo 8. PATH TOO LONG echo Current: %PATH_LENGTH% characters echo Limit: 260 characters echo Solution: Move to C:\SysTest\ echo. -echo 10. AMD GPU NOT DETECTED -echo FIXED: Script now checks ALL registry subkeys -echo If still not detected: -echo - Update AMD drivers -echo - Check Device Manager -echo - Verify GPU is enabled -echo. -echo 11. GPU-Z FILE CORRUPTED -echo FIXED: Script now validates file size -echo Expected: 5-10 MB -echo If corrupted, re-download from TechPowerUp -echo. echo -------------------------------------------------------- echo FEATURES: echo -------------------------------------------------------- echo. -echo NETWORK SPEED TESTING: -echo - Gateway connectivity tests -echo - Internet endpoint testing (Google, Cloudflare, MS) -echo - Latency measurements to multiple servers -echo - PSPing bandwidth capacity testing -echo - DNS resolution speed testing -echo - MTU path discovery -echo. echo REPORT TYPES: echo Clean Report - Summary with key findings echo Detailed Report - Full output from all tests @@ -784,6 +649,12 @@ echo Checks digital signatures of all tools echo Validates file sizes echo Identifies Microsoft-signed vs others echo. +echo GPU TESTING: +echo Enhanced multi-GPU support +echo NVIDIA-SMI integration +echo AMD driver detection +echo GPU-Z download assistant +echo. echo ADMIN DETECTION: echo Auto-elevates on startup echo Skips admin-required tests when not elevated @@ -798,7 +669,7 @@ goto MENU :EXIT echo. echo ======================================================== -echo Thank you for using Portable Sysinternals System Tester! +echo Thank you for using PNW Computers' Portable Sysinternals System Tester! echo Version %SCRIPT_VERSION% echo ======================================================== echo. From 7c6ff97fde9206d4a1c4d424bdd4df00b61aa02e Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:44:41 -0700 Subject: [PATCH 08/37] Update SystemTester.ps1 --- SystemTester.ps1 | 453 +++++++++++++++++++++++------------------------ 1 file changed, 223 insertions(+), 230 deletions(-) diff --git a/SystemTester.ps1 b/SystemTester.ps1 index ff83c5a..d6f69ff 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -1,17 +1,16 @@ -# Portable Sysinternals System Tester - FIXED VERSION +# Portable Sysinternals System Tester # Created by Pacific Northwest Computers - 2025 -# Complete Production Version - v2.2 (Debugged) +# Complete Production Version - v2.2 param([switch]$AutoRun) # Constants $script:VERSION = "2.2" -$script:DXDIAG_TIMEOUT = 50 -$script:ENERGY_DURATION = 20 -$script:CPU_TEST_SECONDS = 30 +$script:DXDIAG_TIMEOUT = 45 +$script:ENERGY_DURATION = 15 +$script:CPU_TEST_SECONDS = 10 $script:MAX_PATH_LENGTH = 240 $script:MIN_TOOL_SIZE_KB = 50 -$script:DNS_TEST_TARGETS = @("google.com", "microsoft.com", "cloudflare.com", "github.com") # Paths $ScriptRoot = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Path } @@ -62,202 +61,171 @@ function Test-AdminPrivileges { } } -# FIXED: Initialize environment -function Initialize-Environment { - Write-Host "`nInitializing environment..." -ForegroundColor Cyan - - Test-LauncherAwareness | Out-Null - Test-AdminPrivileges | Out-Null - - if ($ScriptRoot.Length -gt $script:MAX_PATH_LENGTH) { - Write-Host "WARNING: Path length ($($ScriptRoot.Length)) exceeds recommended maximum" -ForegroundColor Yellow - Write-Host " Consider moving to a shorter path like C:\SysTest\" -ForegroundColor Yellow - } - - if (!(Test-Path $SysinternalsPath)) { - Write-Host "ERROR: Sysinternals folder not found at: $SysinternalsPath" -ForegroundColor Red - Write-Host "" -ForegroundColor Red - if ($script:LaunchedViaBatch) { - Write-Host "ACTION: Return to batch launcher and use Menu Option 5 to download tools" -ForegroundColor Yellow - } else { - Write-Host "ACTION: Download Sysinternals Suite from:" -ForegroundColor Yellow - Write-Host " https://download.sysinternals.com/files/SysinternalsSuite.zip" -ForegroundColor Yellow - Write-Host " Extract to: $SysinternalsPath" -ForegroundColor Yellow - } - return $false - } - - $requiredTools = @("psinfo.exe", "coreinfo.exe", "pslist.exe", "handle.exe", "clockres.exe") - $found = 0 - $missing = @() - - foreach ($tool in $requiredTools) { - $toolPath = Join-Path $SysinternalsPath $tool - if (Test-Path $toolPath) { - $found++ - } else { - $missing += $tool - } - } - - if ($found -eq 0) { - Write-Host "ERROR: No Sysinternals tools found in $SysinternalsPath" -ForegroundColor Red - if ($script:LaunchedViaBatch) { - Write-Host "ACTION: Use Batch Menu Option 5 to download tools" -ForegroundColor Yellow - } - return $false - } - - Write-Host "Environment check: $found/$($requiredTools.Count) key tools found" -ForegroundColor Green - - if ($missing.Count -gt 0) { - Write-Host "Missing tools: $($missing -join ', ')" -ForegroundColor Yellow - if ($script:LaunchedViaBatch) { - Write-Host "TIP: Use Batch Menu Option 4 to verify integrity" -ForegroundColor DarkYellow - Write-Host " Use Batch Menu Option 5 to update tools" -ForegroundColor DarkYellow - } - } - - $pspingPath = Join-Path $SysinternalsPath "psping.exe" - if (Test-Path $pspingPath) { - Write-Host "PSPing detected - Network speed tests available" -ForegroundColor Green - } else { - Write-Host "PSPing not found - Basic network tests only" -ForegroundColor Yellow - } - - Write-Host "Environment initialized successfully" -ForegroundColor Green - return $true -} - -# FIXED: Tool integrity verification +# Tool integrity verification function Test-ToolIntegrity { - param( - [Parameter(Mandatory=$true)] - [string]$ToolName - ) + param([string]$ToolName) $toolPath = Join-Path $SysinternalsPath "$ToolName.exe" + # Check if file exists if (!(Test-Path $toolPath)) { - return @{ - Status="NOT_FOUND" - Details="Tool not found at: $toolPath" - } + return @{Status="MISSING"; Details="File not found"} } + # Check file size $fileInfo = Get-Item $toolPath - $sizeKB = [math]::Round($fileInfo.Length / 1KB, 2) - - if ($sizeKB -lt $script:MIN_TOOL_SIZE_KB) { - return @{ - Status="SUSPICIOUS_SIZE" - Details="File size ($sizeKB KB) is suspiciously small" - } + if ($fileInfo.Length -lt ($script:MIN_TOOL_SIZE_KB * 1KB)) { + return @{Status="BAD_SIZE"; Details="File too small: $($fileInfo.Length) bytes"} } + # Check digital signature try { $signature = Get-AuthenticodeSignature $toolPath -ErrorAction Stop if ($signature.Status -eq "Valid") { $subject = $signature.SignerCertificate.Subject if ($subject -match "Microsoft Corporation") { - return @{ - Status="VALID_MS" - Details="Valid Microsoft signature | Size: $sizeKB KB" - } + return @{Status="VALID_MS"; Details="Valid Microsoft signature"} } else { - return @{ - Status="VALID_OTHER" - Details="Valid non-Microsoft signature: $subject | Size: $sizeKB KB" - } + return @{Status="VALID_OTHER"; Details="Valid non-Microsoft signature: $subject"} } } elseif ($signature.Status -eq "NotSigned") { - return @{ - Status="NOT_SIGNED" - Details="File is not digitally signed | Size: $sizeKB KB" - } + return @{Status="NOT_SIGNED"; Details="File is not digitally signed"} } else { - return @{ - Status="BAD_SIGNATURE" - Details="Signature status: $($signature.Status) | Size: $sizeKB KB" - } + return @{Status="BAD_SIGNATURE"; Details="Signature status: $($signature.Status)"} } } catch { - return @{ - Status="CHECK_FAILED" - Details="Error checking signature: $($_.Exception.Message)" - } + return @{Status="CHECK_FAILED"; Details="Error: $($_.Exception.Message)"} } } -# FIXED: Added missing function for batch launcher +# Verify all tools function Test-ToolVerification { - Write-Host "" - Write-Host "========================================" -ForegroundColor Cyan + Write-Host "`n========================================" -ForegroundColor Cyan Write-Host " TOOL INTEGRITY VERIFICATION" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan Write-Host "" - if (!(Test-Path $SysinternalsPath)) { - Write-Host "ERROR: Sysinternals folder not found: $SysinternalsPath" -ForegroundColor Red - return - } - - $tools = Get-ChildItem -Path $SysinternalsPath -Filter "*.exe" -ErrorAction SilentlyContinue - - if (!$tools) { - Write-Host "ERROR: No tools found in $SysinternalsPath" -ForegroundColor Red - return - } - - Write-Host "Checking $($tools.Count) tools..." -ForegroundColor Yellow - Write-Host "" + $allTools = @( + "psinfo","coreinfo","pslist","handle","clockres", + "autorunsc","du","streams","contig","sigcheck", + "testlimit","diskext","listdlls" + ) - $results = @{ - ValidMS = 0 - ValidOther = 0 - NotSigned = 0 - BadSignature = 0 - Failed = 0 - Suspicious = 0 + $stats = @{ + VALID_MS=0; VALID_OTHER=0; NOT_SIGNED=0 + BAD_SIZE=0; BAD_SIGNATURE=0; MISSING=0; CHECK_FAILED=0 } - foreach ($tool in $tools) { - $toolName = $tool.BaseName - $result = Test-ToolIntegrity -ToolName $toolName + foreach ($tool in $allTools) { + $result = Test-ToolIntegrity -ToolName $tool + $stats[$result.Status]++ - $statusColor = switch ($result.Status) { - "VALID_MS" { $results.ValidMS++; "Green" } - "VALID_OTHER" { $results.ValidOther++; "Cyan" } - "NOT_SIGNED" { $results.NotSigned++; "Yellow" } - "BAD_SIGNATURE" { $results.BadSignature++; "Red" } - "SUSPICIOUS_SIZE" { $results.Suspicious++; "Red" } - "CHECK_FAILED" { $results.Failed++; "Red" } - default { "Gray" } + $color = switch ($result.Status) { + "VALID_MS" { "Green" } + "VALID_OTHER" { "Cyan" } + "NOT_SIGNED" { "Yellow" } + "MISSING" { "Red" } + "BAD_SIZE" { "Red" } + "BAD_SIGNATURE" { "Red" } + "CHECK_FAILED" { "Yellow" } } - Write-Host ("{0,-20} : {1,-15} | {2}" -f $toolName, $result.Status, $result.Details) -ForegroundColor $statusColor + $statusText = switch ($result.Status) { + "VALID_MS" { "[OK-MS]" } + "VALID_OTHER" { "[OK-OTHER]" } + "NOT_SIGNED" { "[NO-SIG]" } + "MISSING" { "[MISSING]" } + "BAD_SIZE" { "[BAD-SIZE]" } + "BAD_SIGNATURE" { "[BAD-SIG]" } + "CHECK_FAILED" { "[ERROR]" } + } + + Write-Host "$statusText $tool" -ForegroundColor $color + if ($result.Details -and $result.Status -ne "VALID_MS") { + Write-Host " $($result.Details)" -ForegroundColor DarkGray + } } Write-Host "" Write-Host "========================================" -ForegroundColor Cyan - Write-Host "SUMMARY:" -ForegroundColor Cyan - Write-Host " Valid (Microsoft): $($results.ValidMS)" -ForegroundColor Green - Write-Host " Valid (Other): $($results.ValidOther)" -ForegroundColor Cyan - Write-Host " Not Signed: $($results.NotSigned)" -ForegroundColor Yellow - Write-Host " Bad Signature: $($results.BadSignature)" -ForegroundColor Red - Write-Host " Suspicious: $($results.Suspicious)" -ForegroundColor Red - Write-Host " Check Failed: $($results.Failed)" -ForegroundColor Red - Write-Host "========================================" -ForegroundColor Cyan + Write-Host "SUMMARY:" -ForegroundColor White + Write-Host " Valid (Microsoft): $($stats.VALID_MS)" -ForegroundColor Green + Write-Host " Valid (Other): $($stats.VALID_OTHER)" -ForegroundColor Cyan + Write-Host " Not Signed: $($stats.NOT_SIGNED)" -ForegroundColor Yellow + Write-Host " Bad Size: $($stats.BAD_SIZE)" -ForegroundColor Red + Write-Host " Bad Signature: $($stats.BAD_SIGNATURE)" -ForegroundColor Red + Write-Host " Missing: $($stats.MISSING)" -ForegroundColor Red + Write-Host " Check Failed: $($stats.CHECK_FAILED)" -ForegroundColor Yellow + Write-Host "" - if ($results.BadSignature -gt 0 -or $results.Suspicious -gt 0) { - Write-Host "" - Write-Host "WARNING: Some tools have issues!" -ForegroundColor Red - Write-Host "ACTION: Re-download Sysinternals Suite (Batch Menu Option 5)" -ForegroundColor Yellow - } elseif ($results.ValidMS -gt 0) { - Write-Host "" - Write-Host "All verified tools are properly signed!" -ForegroundColor Green + $totalIssues = $stats.BAD_SIZE + $stats.BAD_SIGNATURE + $stats.MISSING + $stats.CHECK_FAILED + if ($totalIssues -eq 0 -and $stats.VALID_MS -gt 0) { + Write-Host "STATUS: All present tools are verified and safe to use" -ForegroundColor Green + } elseif ($totalIssues -gt 0) { + Write-Host "STATUS: $totalIssues issue(s) detected - recommend re-download" -ForegroundColor Yellow + if ($script:LaunchedViaBatch) { + Write-Host "ACTION: Use Batch Menu Option 5 to re-download tools" -ForegroundColor Yellow + } + } + Write-Host "" +} + +# Initialize environment +function Initialize-Environment { + Write-Host "Initializing..." -ForegroundColor Yellow + + Test-LauncherAwareness | Out-Null + Test-AdminPrivileges | Out-Null + + # Path length check + if ($ScriptRoot.Length -gt $script:MAX_PATH_LENGTH) { + Write-Host "WARNING: Path length is $($ScriptRoot.Length) chars" -ForegroundColor Yellow + Write-Host " Consider moving to shorter path (Windows limit: 260)" -ForegroundColor Yellow + } + + # Check tools folder + if (!(Test-Path $SysinternalsPath)) { + Write-Host "ERROR: Sysinternals folder not found!" -ForegroundColor Red + Write-Host "Expected: $SysinternalsPath" -ForegroundColor Yellow + if ($script:LaunchedViaBatch) { + Write-Host "ACTION: Use Batch Menu Option 5 to download tools automatically" -ForegroundColor Yellow + } else { + Write-Host "ACTION: Download from https://download.sysinternals.com/files/SysinternalsSuite.zip" -ForegroundColor Yellow + Write-Host " Extract to: $SysinternalsPath" -ForegroundColor Yellow + } + return $false + } + + # Check for key tools + $tools = @("psinfo.exe","coreinfo.exe","pslist.exe","handle.exe","clockres.exe") + $found = 0 + $missing = @() + foreach ($tool in $tools) { + if (Test-Path (Join-Path $SysinternalsPath $tool)) { + $found++ + } else { + $missing += $tool + } + } + + if ($found -eq 0) { + Write-Host "ERROR: No tools found in $SysinternalsPath" -ForegroundColor Red + if ($script:LaunchedViaBatch) { + Write-Host "ACTION: Use Batch Menu Option 5 to download tools" -ForegroundColor Yellow + } + return $false + } + + Write-Host "Found $found/$($tools.Count) key tools" -ForegroundColor Green + if ($missing.Count -gt 0) { + Write-Host "Missing: $($missing -join ', ')" -ForegroundColor Yellow + if ($script:LaunchedViaBatch) { + Write-Host "TIP: Use Batch Menu Option 4 for integrity check" -ForegroundColor DarkYellow + Write-Host " Use Batch Menu Option 5 to update tools" -ForegroundColor DarkYellow + } } + return $true } # Clean tool output @@ -269,9 +237,11 @@ function Clean-ToolOutput { $cleaned = @() foreach ($line in $lines) { + # Skip boilerplate if ($line -match "Copyright|Sysinternals|www\.|EULA|Mark Russinovich|David Solomon|Bryce Cogswell") { continue } if ($line -match "^-+$|^=+$|^\*+$") { continue } + # Tool-specific filtering switch ($ToolName) { "psinfo" { if ($line -match "^(System|Uptime|Kernel|Product|Service|Build|Processors|Physical|Computer|Domain|Install)") { @@ -324,13 +294,12 @@ function Run-Tool { Write-Host "Running $ToolName..." -ForegroundColor Cyan try { $start = Get-Date - - if ($ToolName -in @("psinfo","pslist","handle","autorunsc","testlimit","contig","coreinfo","streams","sigcheck")) { + if ($ToolName -in @("psinfo","pslist","handle","autorunsc","testlimit","contig")) { $Args = "-accepteula $Args" } $argArray = if ($Args.Trim()) { $Args.Split(' ') | Where-Object { $_ } } else { @() } - $rawOutput = & "$toolPath" $argArray 2>&1 | Out-String + $rawOutput = & $toolPath $argArray 2>&1 | Out-String $duration = ((Get-Date) - $start).TotalMilliseconds $cleanOutput = Clean-ToolOutput -ToolName $ToolName -RawOutput $rawOutput @@ -400,9 +369,6 @@ L3 Cache: $($cpu.L3CacheSize) KB Write-Host "Error getting CPU details" -ForegroundColor Yellow } - Run-Tool -ToolName "pslist" -Args "-t" -Description "Process tree snapshot" - Run-Tool -ToolName "handle" -Args "-p explorer" -Description "Explorer handles" - Write-Host "Running CPU test ($script:CPU_TEST_SECONDS sec - synthetic)..." -ForegroundColor Yellow try { $start = Get-Date @@ -424,14 +390,17 @@ L3 Cache: $($cpu.L3CacheSize) KB } } -# Test: Memory +# Test: Memory (FIXED) function Test-Memory { Write-Host "`n=== RAM Testing ===" -ForegroundColor Green try { $mem = Get-CimInstance Win32_ComputerSystem -ErrorAction Stop $os = Get-CimInstance Win32_OperatingSystem -ErrorAction Stop $totalGB = [math]::Round($mem.TotalPhysicalMemory/1GB,2) + + # FIX: FreePhysicalMemory is in KB, convert to GB correctly $availGB = [math]::Round($os.FreePhysicalMemory/1024/1024,2) + $usedGB = $totalGB - $availGB $usage = [math]::Round(($usedGB/$totalGB)*100,1) @@ -475,6 +444,7 @@ function Test-Storage { Run-Tool -ToolName "du" -Args "-l 2 C:\" -Description "Disk usage C:" + # Disk performance test Write-Host "Running disk test..." -ForegroundColor Yellow try { $testFile = Join-Path $env:TEMP "disktest_$([guid]::NewGuid().ToString('N')).tmp" @@ -565,7 +535,7 @@ function Test-OSHealth { } } -# FIXED: Test-StorageSMART (removed wrong DISM/SFC code) +# Test: SMART function Test-StorageSMART { Write-Host "`n=== Storage SMART ===" -ForegroundColor Green try { @@ -578,7 +548,7 @@ function Test-StorageSMART { } catch {} if (-not $lines) { $lines = @("SMART data not available (driver limitation)") } - + $script:TestResults += @{ Tool="Storage-SMART"; Description="SMART data" Status="SUCCESS"; Output=($lines -join "`n"); Duration=100 @@ -589,7 +559,7 @@ function Test-StorageSMART { } } -# FIXED: Test-Trim (corrected output message) +# Test: TRIM function Test-Trim { Write-Host "`n=== SSD TRIM Status ===" -ForegroundColor Green try { @@ -634,10 +604,11 @@ function Test-NIC { } } -# Test: GPU +# Test: GPU (Enhanced) function Test-GPU { Write-Host "`n=== GPU Testing (Enhanced) ===" -ForegroundColor Green + # Part 1: Detailed WMI/CIM GPU Information Write-Host "Gathering GPU details..." -ForegroundColor Yellow try { $gpus = Get-CimInstance Win32_VideoController -ErrorAction Stop @@ -681,6 +652,7 @@ function Test-GPU { Write-Host "Error getting GPU details: $($_.Exception.Message)" -ForegroundColor Yellow } + # Part 2: Display Configuration Write-Host "Analyzing display configuration..." -ForegroundColor Yellow try { $monitors = Get-CimInstance WmiMonitorID -Namespace root\wmi -ErrorAction Stop @@ -694,16 +666,19 @@ function Test-GPU { $displayInfo += "Display #$index" $displayInfo += "-" * 40 + # Decode manufacturer name if ($monitor.ManufacturerName) { $mfg = [System.Text.Encoding]::ASCII.GetString($monitor.ManufacturerName -ne 0) $displayInfo += "Manufacturer: $mfg" } + # Decode product name if ($monitor.UserFriendlyName) { $name = [System.Text.Encoding]::ASCII.GetString($monitor.UserFriendlyName -ne 0) $displayInfo += "Model: $name" } + # Decode serial number if ($monitor.SerialNumberID) { $serial = [System.Text.Encoding]::ASCII.GetString($monitor.SerialNumberID -ne 0) $displayInfo += "Serial: $serial" @@ -723,6 +698,7 @@ function Test-GPU { Write-Host "Display configuration unavailable" -ForegroundColor Yellow } + # Part 3: GPU Driver Details (Enhanced) Write-Host "Checking GPU drivers..." -ForegroundColor Yellow try { $drivers = Get-CimInstance Win32_PnPSignedDriver -ErrorAction Stop | @@ -748,6 +724,7 @@ function Test-GPU { Write-Host "Driver details unavailable" -ForegroundColor Yellow } + # Part 4: DirectX Diagnostics (Enhanced) Write-Host "Running DirectX diagnostics..." -ForegroundColor Yellow $dxProcess = $null try { @@ -761,18 +738,21 @@ function Test-GPU { Start-Sleep -Milliseconds 500 $elapsed += 0.5 } - + if (Test-Path $dx) { Start-Sleep -Seconds 1 $raw = Get-Content $dx -Raw -ErrorAction Stop Remove-Item $dx -ErrorAction SilentlyContinue + # Extract more detailed info $dxInfo = @() + # DirectX version if ($raw -match "DirectX Version: (.+)") { $dxInfo += "DirectX Version: $($matches[1])" } + # Display devices section $lines = $raw -split "`r?`n" $inDisplaySection = $false $displayLines = @() @@ -813,6 +793,7 @@ function Test-GPU { } } + # Part 5: OpenGL Information Write-Host "Checking OpenGL support..." -ForegroundColor Yellow try { $openglInfo = @() @@ -839,21 +820,25 @@ function Test-GPU { Write-Host "OpenGL check skipped" -ForegroundColor DarkGray } + # Part 6: GPU Performance Capabilities Write-Host "Checking GPU capabilities..." -ForegroundColor Yellow try { $capabilities = @() + # Check for hardware acceleration $dwm = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\Dwm" -ErrorAction SilentlyContinue if ($dwm) { $capabilities += "DWM Composition: Enabled" } + # Check for GPU scheduling $gpuScheduling = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -ErrorAction SilentlyContinue if ($gpuScheduling.HwSchMode) { $schedStatus = if ($gpuScheduling.HwSchMode -eq 2) { "Enabled" } else { "Disabled" } $capabilities += "Hardware-Accelerated GPU Scheduling: $schedStatus" } + # Check DirectX feature levels $gpus = Get-CimInstance Win32_VideoController foreach ($gpu in $gpus) { if ($gpu.Name) { @@ -882,10 +867,11 @@ function Test-GPU { } } -# FIXED: Test-GPUVendorSpecific (AMD detection now checks all registry keys) +# Test: Vendor-Specific GPU Testing (NVIDIA/AMD) function Test-GPUVendorSpecific { Write-Host "`n=== Vendor-Specific GPU Testing ===" -ForegroundColor Green + # Check for NVIDIA try { $nvidiaSmi = "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" if (Test-Path $nvidiaSmi) { @@ -900,6 +886,7 @@ function Test-GPUVendorSpecific { Write-Host "NVIDIA metrics collected" -ForegroundColor Green + # Get more detailed info $detailedOutput = & $nvidiaSmi -q 2>&1 | Out-String $script:TestResults += @{ @@ -918,48 +905,35 @@ function Test-GPUVendorSpecific { Write-Host "NVIDIA test failed: $($_.Exception.Message)" -ForegroundColor Yellow } + # Check for AMD try { - $videoControllerPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" + $amdRegistry = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" - if (Test-Path $videoControllerPath) { - $amdFound = $false - $amdOutput = @() - $amdOutput += "AMD GPU Detection Results:" - $amdOutput += "" + if (Test-Path $amdRegistry) { + $amdInfo = Get-ItemProperty $amdRegistry -ErrorAction Stop - Get-ChildItem $videoControllerPath -ErrorAction Stop | ForEach-Object { - try { - $props = Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue - if ($props.DriverDesc -match "AMD|Radeon") { - $amdFound = $true - $amdOutput += "Device Found:" - $amdOutput += " Driver Description: $($props.DriverDesc)" - $amdOutput += " Driver Version: $($props.DriverVersion)" - $amdOutput += " Driver Date: $($props.DriverDate)" - $amdOutput += " Registry Key: $($_.PSChildName)" - $amdOutput += "" - } - } catch {} - } + $amdOutput = @() + $amdOutput += "AMD GPU Detected" + $amdOutput += "Driver Description: $($amdInfo.DriverDesc)" + $amdOutput += "Driver Version: $($amdInfo.DriverVersion)" + $amdOutput += "Driver Date: $($amdInfo.DriverDate)" - if ($amdFound) { + if ($amdInfo.DriverDesc -match "AMD|Radeon") { $script:TestResults += @{ Tool="AMD-GPU"; Description="AMD GPU information" Status="SUCCESS"; Output=($amdOutput -join "`n"); Duration=100 } Write-Host "AMD GPU information collected" -ForegroundColor Green - } else { - Write-Host "AMD GPU not detected" -ForegroundColor DarkGray - $script:TestResults += @{ - Tool="AMD-GPU"; Description="AMD GPU information" - Status="SKIPPED"; Output="No AMD GPU detected in registry"; Duration=0 - } } } else { - Write-Host "Video controller registry path not found" -ForegroundColor DarkGray + Write-Host "AMD GPU not detected" -ForegroundColor DarkGray + $script:TestResults += @{ + Tool="AMD-GPU"; Description="AMD GPU information" + Status="SKIPPED"; Output="No AMD GPU detected"; Duration=0 + } } } catch { - Write-Host "AMD GPU check error: $($_.Exception.Message)" -ForegroundColor Yellow + Write-Host "AMD GPU check unavailable" -ForegroundColor DarkGray } } @@ -975,6 +949,7 @@ function Test-GPUMemory { Write-Host "Testing $($gpu.Name) - $totalRAM GB VRAM" -ForegroundColor Yellow + # Get current usage via performance counters (if available) try { $perfCounters = Get-Counter -Counter "\GPU Engine(*)\Running Time" -ErrorAction Stop @@ -990,6 +965,7 @@ function Test-GPUMemory { Write-Host "GPU memory test complete" -ForegroundColor Green } catch { + # Fallback to basic info $usage = @() $usage += "GPU: $($gpu.Name)" $usage += "Total VRAM: $totalRAM GB" @@ -1072,13 +1048,10 @@ function Test-HardwareEvents { } } -# FIXED: Test-WindowsUpdate (improved COM cleanup) +# Test: Windows Update function Test-WindowsUpdate { Write-Host "`n=== Windows Update ===" -ForegroundColor Green $updateSession = $null - $searcher = $null - $result = $null - try { $lines = @() try { @@ -1107,25 +1080,19 @@ function Test-WindowsUpdate { } catch { Write-Host "Windows Update check failed" -ForegroundColor Yellow } finally { - if ($result) { - try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($result) | Out-Null } catch {} - } - if ($searcher) { - try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($searcher) | Out-Null } catch {} - } if ($updateSession) { try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($updateSession) | Out-Null } catch {} } [System.GC]::Collect() - [System.GC]::WaitForPendingFinalizers() - [System.GC]::Collect() } } -# Generate Reports +# Generate Dual Reports (Clean + Detailed) - ENHANCED VERSION +# Replace the entire Generate-Report function in SystemTester.ps1 (around line 1260) function Generate-Report { Write-Host "`nGenerating reports..." -ForegroundColor Cyan + # Test write access $testFile = Join-Path $ScriptRoot "writetest_$([guid]::NewGuid().ToString('N')).tmp" try { "test" | Out-File -FilePath $testFile -ErrorAction Stop @@ -1139,12 +1106,14 @@ function Generate-Report { $cleanPath = Join-Path $ScriptRoot "SystemTest_Clean_$timestamp.txt" $detailedPath = Join-Path $ScriptRoot "SystemTest_Detailed_$timestamp.txt" + # Calculate stats $success = ($TestResults | Where-Object {$_.Status -eq "SUCCESS"}).Count $failed = ($TestResults | Where-Object {$_.Status -eq "FAILED"}).Count $skipped = ($TestResults | Where-Object {$_.Status -eq "SKIPPED"}).Count $total = $TestResults.Count $successRate = if ($total -gt 0) { [math]::Round(($success/$total)*100,1) } else { 0 } + # === CLEAN REPORT === $cleanReport = @() $cleanReport += "=========================================" $cleanReport += " SYSTEM TEST REPORT v$script:VERSION" @@ -1166,6 +1135,7 @@ function Generate-Report { $cleanReport += "KEY FINDINGS:" $cleanReport += "-------------" + # Extract key info from results $sysInfo = $TestResults | Where-Object {$_.Tool -eq "System-Overview"} if ($sysInfo) { $cleanReport += "" @@ -1191,21 +1161,26 @@ function Generate-Report { if ($gpuDetails -and $gpuDetails.Output -match "GPU #1") { $cleanReport += "" $cleanReport += "GPU:" + # Extract just the first GPU's name $gpuLines = $gpuDetails.Output -split "`n" foreach ($line in $gpuLines) { if ($line -match "Name:|Adapter RAM:|Driver Version:") { $cleanReport += " $line" } - if ($line -match "GPU #2") { break } + if ($line -match "GPU #2") { break } # Stop at second GPU } } + # ======================================== + # ENHANCED RECOMMENDATIONS ENGINE + # ======================================== $cleanReport += "" $cleanReport += "RECOMMENDATIONS:" $cleanReport += "----------------" $recommendations = @() + # === MEMORY ANALYSIS === if ($ramInfo -and $ramInfo.Output -match "Usage: ([\d\.]+)%") { $usage = [float]$matches[1] if ($usage -gt 85) { @@ -1222,6 +1197,7 @@ function Generate-Report { } } + # === STORAGE HEALTH === $smartInfo = $TestResults | Where-Object {$_.Tool -eq "Storage-SMART"} if ($smartInfo -and $smartInfo.Output -notmatch "not available") { if ($smartInfo.Output -match "Warning|Caution|Failed|Degraded") { @@ -1232,10 +1208,12 @@ function Generate-Report { } } + # === STORAGE PERFORMANCE === if ($diskPerf -and $diskPerf.Output -match "Write: ([\d\.]+) MB/s.*Read: ([\d\.]+) MB/s") { $writeSpeed = [float]$matches[1] $readSpeed = [float]$matches[2] + # HDD typical: 80-160 MB/s, SSD typical: 200-550 MB/s (SATA), NVMe: 1500+ MB/s if ($writeSpeed -lt 50 -or $readSpeed -lt 50) { $recommendations += "• WARNING: Very slow disk performance detected" $recommendations += " → Write: $writeSpeed MB/s, Read: $readSpeed MB/s" @@ -1250,6 +1228,7 @@ function Generate-Report { } } + # === STORAGE CAPACITY === $storageInfo = $TestResults | Where-Object {$_.Tool -eq "Storage-Overview"} if ($storageInfo) { $drives = $storageInfo.Output -split "`n" | Where-Object {$_ -match "([A-Z]:).*\((\d+)%\)"} @@ -1273,6 +1252,7 @@ function Generate-Report { } } + # === SSD TRIM STATUS === $trimInfo = $TestResults | Where-Object {$_.Tool -eq "SSD-TRIM"} if ($trimInfo -and $trimInfo.Output -match "Disabled") { $recommendations += "• WARNING: TRIM is disabled for SSD" @@ -1280,6 +1260,7 @@ function Generate-Report { $recommendations += " → TRIM maintains SSD performance and longevity" } + # === NETWORK PERFORMANCE === $nicInfo = $TestResults | Where-Object {$_.Tool -eq "NIC-Info"} if ($nicInfo) { if ($nicInfo.Output -match "10 Mbps|100 Mbps") { @@ -1296,6 +1277,7 @@ function Generate-Report { } } + # === WINDOWS UPDATE === $updateInfo = $TestResults | Where-Object {$_.Tool -eq "Windows-Update"} if ($updateInfo) { if ($updateInfo.Output -match "Pending: (\d+)") { @@ -1320,6 +1302,7 @@ function Generate-Report { } } + # === OS HEALTH (DISM/SFC) === $osHealth = $TestResults | Where-Object {$_.Tool -eq "OS-Health"} if ($osHealth -and $osHealth.Status -eq "SUCCESS") { if ($osHealth.Output -match "corrupt|error|repairable") { @@ -1330,6 +1313,7 @@ function Generate-Report { } } + # === HARDWARE ERRORS (WHEA) === $wheaInfo = $TestResults | Where-Object {$_.Tool -eq "WHEA"} if ($wheaInfo -and $wheaInfo.Output -notmatch "No WHEA errors") { $recommendations += "• WARNING: Hardware errors detected in event log" @@ -1339,6 +1323,7 @@ function Generate-Report { $recommendations += " → Check for overheating issues" } + # === CPU PERFORMANCE === $cpuPerf = $TestResults | Where-Object {$_.Tool -eq "CPU-Performance"} if ($cpuPerf -and $cpuPerf.Output -match "Ops/sec: (\d+)") { $opsPerSec = [int]$matches[1] @@ -1351,22 +1336,21 @@ function Generate-Report { } } - # FIXED: Added try/catch for GPU driver year parsing + # === GPU HEALTH === if ($gpuDetails) { if ($gpuDetails.Output -match "Driver Date:.*(\d{4})") { - try { - $driverYear = [int]$matches[1] - $currentYear = (Get-Date).Year - if ($currentYear - $driverYear -gt 1) { - $recommendations += "• INFO: GPU drivers are over 1 year old ($driverYear)" - $recommendations += " → Update to latest drivers for best performance" - $recommendations += " → NVIDIA: GeForce Experience or nvidia.com" - $recommendations += " → AMD: amd.com/en/support" - } - } catch {} + $driverYear = [int]$matches[1] + $currentYear = (Get-Date).Year + if ($currentYear - $driverYear -gt 1) { + $recommendations += "• INFO: GPU drivers are over 1 year old" + $recommendations += " → Update to latest drivers for best performance" + $recommendations += " → NVIDIA: GeForce Experience or nvidia.com" + $recommendations += " → AMD: amd.com/en/support" + } } } + # === BATTERY HEALTH (Laptops) === $powerInfo = $TestResults | Where-Object {$_.Tool -eq "Power-Energy"} if ($powerInfo -and $powerInfo.Output -match "Battery") { if ($powerInfo.Output -match "energy-report.html") { @@ -1375,6 +1359,7 @@ function Generate-Report { } } + # === OVERALL SYSTEM HEALTH === if ($failed -gt 5) { $recommendations += "• CRITICAL: Multiple test failures ($failed failures)" $recommendations += " → Review detailed report for specific issues" @@ -1389,6 +1374,7 @@ function Generate-Report { $recommendations += " → Run as administrator for complete diagnostics" } + # === GENERAL MAINTENANCE === if ($recommendations.Count -lt 3) { $recommendations += "" $recommendations += "GENERAL MAINTENANCE TIPS:" @@ -1399,6 +1385,7 @@ function Generate-Report { $recommendations += "• Back up important data regularly" } + # Add all recommendations to report foreach ($rec in $recommendations) { $cleanReport += $rec } @@ -1407,6 +1394,7 @@ function Generate-Report { $cleanReport += "For detailed output, see: $detailedPath" $cleanReport += "" + # === DETAILED REPORT === $detailedReport = @() $detailedReport += "=========================================" $detailedReport += " SYSTEM TEST REPORT v$script:VERSION" @@ -1437,6 +1425,7 @@ function Generate-Report { $detailedReport += "-" * 80 } + # Save reports try { $cleanReport | Out-File -FilePath $cleanPath -Encoding UTF8 $detailedReport | Out-File -FilePath $detailedPath -Encoding UTF8 @@ -1499,7 +1488,7 @@ function Show-Menu { Write-Host "18. Clear Results" -ForegroundColor Red Write-Host "Q. Quit" Write-Host "" - Write-Host "Tests completed: $($script:TestResults.Count)" -ForegroundColor Gray + Write-Host "Tests completed: $($TestResults.Count)" -ForegroundColor Gray } function Start-Menu { @@ -1519,20 +1508,24 @@ function Start-Menu { "10" { Test-Trim; Read-Host "`nPress Enter" } "11" { Test-NIC; Read-Host "`nPress Enter" } "12" { + # Run all GPU tests when "12" is selected Test-GPU Test-GPUVendorSpecific Test-GPUMemory Read-Host "`nPress Enter" } "12a" { + # Basic GPU info only Test-GPU Read-Host "`nPress Enter" } "12b" { + # Vendor-specific only Test-GPUVendorSpecific Read-Host "`nPress Enter" } "12c" { + # GPU memory test only Test-GPUMemory Read-Host "`nPress Enter" } @@ -1544,7 +1537,7 @@ function Start-Menu { Test-SystemInfo; Test-CPU; Test-Memory; Test-Storage Test-Processes; Test-Security; Test-Network; Test-OSHealth Test-StorageSMART; Test-Trim; Test-NIC - Test-GPU; Test-GPUVendorSpecific; Test-GPUMemory + Test-GPU; Test-GPUVendorSpecific; Test-GPUMemory # All GPU tests Test-Power; Test-HardwareEvents; Test-WindowsUpdate Write-Host "`nAll tests complete!" -ForegroundColor Green Read-Host "Press Enter" @@ -1558,7 +1551,7 @@ function Start-Menu { } while ($choice -ne "Q" -and $choice -ne "q") } -# Main +# Main - only execute if script is run directly (not dot-sourced) if ($MyInvocation.InvocationName -ne '.') { try { Write-Host "Starting Sysinternals Tester v$script:VERSION..." -ForegroundColor Green From 726fa89b7e6551567aec592ccc65d9ef5b025a0d Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:45:37 -0700 Subject: [PATCH 09/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 630fada..48d519f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🧰 Portable Sysinternals System Tester v2.2 (FIX IN PROGRESS) +# 🧰 Portable Sysinternals System Tester v2.2 (FIXED) **Thumb-drive friendly, no-install Windows hardware health check toolkit** powered by **Sysinternals** and **PowerShell**. From dead6bf3552cb39be0135fab20e594a45dbd9e3a Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:46:52 -0700 Subject: [PATCH 10/37] Create .gitkeep --- Config/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 Config/.gitkeep diff --git a/Config/.gitkeep b/Config/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Config/.gitkeep @@ -0,0 +1 @@ + From 868614b3f297c5d4808cc1a8ababfdaa3946f89c Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:47:26 -0700 Subject: [PATCH 11/37] Create CODE_OF_CONDUCT.md --- .github/CODE_OF_CONDUCT.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..71f7c85 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,6 @@ +# Code of Conduct + +We are committed to a welcoming and inclusive community. We adopt the +[Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). + +For enforcement or to report an incident, contact **coc@example.com**. From 59d1af0d79fc7033da0baee6a31127aa701c9b27 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:47:45 -0700 Subject: [PATCH 12/37] Create CONTRIBUTING.md --- .github/CONTRIBUTING.md | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..ec868cd --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,96 @@ +# Contributing to DeployWorkstation + +Thank you for your interest in contributing to DeployWorkstation! This document provides guidelines and information for contributors. + +## 🎯 Ways to Contribute + +### 🐛 Bug Reports +- Use the bug report template +- Include system information and logs +- Provide clear reproduction steps + +### 💡 Feature Requests +- Use the feature request template +- Explain the use case and business value +- Consider implementation complexity + +### 🔧 Code Contributions +- Fork the repository +- Create a feature branch +- Follow PowerShell best practices +- Add tests for new functionality +- Update documentation + +### 📖 Documentation +- Improve README clarity +- Add configuration examples +- Create troubleshooting guides +- Fix typos and formatting + +## 🔄 Development Process + +### Setting Up Development Environment +1. Fork the repository +2. Clone your fork locally +3. Create a feature branch: `git checkout -b feature/your-feature-name` +4. Make your changes +5. Test thoroughly on multiple Windows versions +6. Commit with clear messages +7. Push to your fork +8. Create a pull request + +### PowerShell Style Guidelines +- Use approved verbs for function names +- Follow PascalCase for functions and variables +- Use meaningful variable names +- Include comment-based help for functions +- Handle errors gracefully +- Use Write-Log for consistent logging + +### Testing Requirements +- Test on Windows 10 and 11 +- Test both domain and workgroup environments +- Verify offline functionality +- Check with different hardware configurations + +## 📋 Code Review Process + +1. **Automated Checks**: PR must pass all automated tests +2. **Manual Review**: Maintainer reviews code and functionality +3. **Testing**: Changes tested in real deployment scenarios +4. **Documentation**: Ensure documentation is updated +5. **Approval**: Maintainer approves and merges PR + +## 🏷️ Commit Message Format + +## Use conventional commits format: +Examples: +type(scope): description +feat(installer): add support for custom MSI packages +fix(logging): resolve log file permission issues +docs(readme): update installation instructions +test(core): add unit tests for bloatware removal + +## 🔒 Security Issues + +For security-related issues: +1. **DO NOT** open a public issue +2. Email security@pnwcomputers.com +3. Include proof of concept (if safe) +4. Allow reasonable time for response + +## 📞 Getting Help + +- Check existing issues and documentation +- Join discussions in GitHub Discussions +- Email support@pnwcomputers.com for questions + +## 🙏 Recognition + +Contributors will be recognized in: +- CHANGELOG.md for significant contributions +- README.md for major features +- GitHub contributors page + +Thank you for helping make DeployWorkstation better! +EOF From bceecb224842d1c193f2c6cb8f1052e35dc17d84 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:48:04 -0700 Subject: [PATCH 13/37] Create PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..db0539d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +## Summary +Explain what this PR changes and why. + +## Type of change +- [ ] Bug fix +- [ ] New feature +- [ ] Docs update +- [ ] Refactor +- [ ] Other (describe): + +## Checklist +- [ ] I ran tests locally and they pass +- [ ] I updated docs/README as needed +- [ ] I linked related issues (e.g., fixes #123) +- [ ] I followed the coding style & conventions + +## Screenshots / Demos +If applicable. + +## Breaking changes +Describe any breaking changes and migration steps. From 6c7e94784d2020abbf2d45403751e132be3801f2 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:48:31 -0700 Subject: [PATCH 14/37] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ec868cd..cbb7a1f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,6 +2,15 @@ Thank you for your interest in contributing to DeployWorkstation! This document provides guidelines and information for contributors. +## 📚 Table of Contents +- [🎯 Ways to Contribute](#-ways-to-contribute) +- [🔄 Development Process](#-development-process) +- [📋 Code Review Process](#-code-review-process) +- [🏷️ Commit Message Format](#-commit-message-format) +- [🔒 Security Issues](#-security-issues) +- [📞 Getting Help](#-getting-help) +- [🙏 Recognition](#-recognition) + ## 🎯 Ways to Contribute ### 🐛 Bug Reports @@ -52,6 +61,16 @@ Thank you for your interest in contributing to DeployWorkstation! This document - Test both domain and workgroup environments - Verify offline functionality - Check with different hardware configurations +- Use virtual machines or sandbox environments when possible +- Validate behavior with and without admin rights +- Test with missing or partial Sysinternals tools to confirm graceful degradation + +## ✅ Pull Request Checklist +- [ ] Code follows PowerShell style guidelines +- [ ] New functionality includes tests +- [ ] Documentation is updated +- [ ] Changes tested on Windows 10 and 11 +- [ ] No sensitive data included ## 📋 Code Review Process @@ -63,13 +82,13 @@ Thank you for your interest in contributing to DeployWorkstation! This document ## 🏷️ Commit Message Format -## Use conventional commits format: +Use conventional commits format: + Examples: -type(scope): description -feat(installer): add support for custom MSI packages -fix(logging): resolve log file permission issues -docs(readme): update installation instructions -test(core): add unit tests for bloatware removal +- `feat(installer): add support for custom MSI packages` +- `fix(logging): resolve log file permission issues` +- `docs(readme): update installation instructions` +- `test(core): add unit tests for bloatware removal` ## 🔒 Security Issues @@ -92,5 +111,4 @@ Contributors will be recognized in: - README.md for major features - GitHub contributors page -Thank you for helping make DeployWorkstation better! -EOF +We’re excited to collaborate with you! Whether it’s a typo fix or a new feature, your contribution makes a difference. From 830103e5cb95ccfedf64aa54a0d5aeeee0965166 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:49:10 -0700 Subject: [PATCH 15/37] Create bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..54513b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: Pnwcomputers + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. From ff5347609e83ee9fa29a4923acdfd13c841950f6 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:49:31 -0700 Subject: [PATCH 16/37] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ad64ca8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Security issue + url: https://example.com/security + about: Please report security vulnerabilities via our security policy. From e3819a0fb3c1ae9b7218c348d1b7fa922798c7be Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:49:49 -0700 Subject: [PATCH 17/37] Create deployment_issue.md --- .github/ISSUE_TEMPLATE/deployment_issue.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/deployment_issue.md diff --git a/.github/ISSUE_TEMPLATE/deployment_issue.md b/.github/ISSUE_TEMPLATE/deployment_issue.md new file mode 100644 index 0000000..a28ca4c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/deployment_issue.md @@ -0,0 +1,19 @@ + +--- +name: Deployment Issue +about: Report problems during workstation deployment +title: '[DEPLOYMENT] ' +labels: 'deployment' +assignees: '' +--- + +## 🖥️ Deployment Environment +- **Target Hardware**: [e.g. Dell OptiPlex 7090] +- **Windows Edition**: [e.g. Windows 11 Pro] +- **Network Environment**: [e.g. Corporate domain, Home network] +- **Deployment Method**: [e.g. USB drive, Network share] + +## ❌ Issue Description +What went wrong during deployment? + +## 📋 Deployment Log From 818275816c4aa1a61b1b0936a1a3f3be5d55f0ce Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:50:05 -0700 Subject: [PATCH 18/37] Create feature_request.md --- .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..2b204ae --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: Pnwcomputers + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 1bafa3b794a99cbdcbafca35e351762b6a5c1ab3 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:50:20 -0700 Subject: [PATCH 19/37] Create implementation-question.md --- .../ISSUE_TEMPLATE/implementation-question.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/implementation-question.md diff --git a/.github/ISSUE_TEMPLATE/implementation-question.md b/.github/ISSUE_TEMPLATE/implementation-question.md new file mode 100644 index 0000000..a2fb00b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/implementation-question.md @@ -0,0 +1,34 @@ +--- +name: Implementation Question +about: Ask how to use or implement something +title: '' +labels: '' +assignees: Pnwcomputers + +--- + +--- +name: Implementation Question +about: Ask how to use or implement something +title: '' +labels: '' +assignees: Pnwcomputers + +--- + +--- +name: "❓ Implementation question" +about: Ask how to use or implement something +title: "[Question]: " +labels: ["question"] +assignees: [] +--- + +**Your question** +What are you trying to do? + +**What you tried** +Briefly list steps, code, or docs you followed. + +**Context** +Version/commit, OS, environment, etc. From 2ae1449f7dc15a0e14dcd1c1fcc96c3d444870b8 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:51:06 -0700 Subject: [PATCH 20/37] Create COMPATABILITY.md --- docs/COMPATABILITY.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/COMPATABILITY.md diff --git a/docs/COMPATABILITY.md b/docs/COMPATABILITY.md new file mode 100644 index 0000000..bcd0050 --- /dev/null +++ b/docs/COMPATABILITY.md @@ -0,0 +1,12 @@ +# Hardware Compatibility + +## Tested Systems +| Manufacturer | Model | Windows 10 | Windows 11 | Notes | +|--------------|-------|------------|------------|-------| +| Dell | OptiPlex 7090 | ✅ | ✅ | Full compatibility | +| HP | EliteDesk 800 | ✅ | ✅ | BIOS update recommended | +| Lenovo | ThinkCentre M920 | ✅ | ⚠️ | Driver issues with Win11 | + +## Known Issues +- Surface devices: Touch driver conflicts +- Gaming laptops: Manufacturer software conflicts From a9724ea2ab4799fb37d61b583621ba3c6b841658 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:52:01 -0700 Subject: [PATCH 21/37] Create INSTALLATION.md --- docs/INSTALLATION.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/INSTALLATION.md diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md new file mode 100644 index 0000000..348f25a --- /dev/null +++ b/docs/INSTALLATION.md @@ -0,0 +1,28 @@ +# Installation Guide + +## System Requirements + +### Minimum Requirements +- **Operating System**: Windows 10 (1909) or Windows 11 +- **PowerShell**: Version 5.1 or later +- **RAM**: 4 GB minimum, 8 GB recommended +- **Storage**: 2 GB free space for applications +- **Network**: Internet connection for WinGet packages + +### Recommended Requirements +- **PowerShell**: Version 7.x for best performance +- **RAM**: 16 GB for development workstations +- **Storage**: SSD for faster deployment +- **Network**: Broadband connection (10+ Mbps) + +## Installation Methods + +### Method 1: Direct Download +1. Download the latest release from GitHub +2. Extract to desired location +3. Run as Administrator + +### Method 2: Git Clone +```bash +git clone https://github.com/Pnwcomputers/SystemTester.git +cd SystemTester From d11168290d0edd4c816d7c5361fd4c023ab637f2 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:52:22 -0700 Subject: [PATCH 22/37] Create TROUBLESHOOTING.md --- docs/TROUBLESHOOTING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/TROUBLESHOOTING.md diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md new file mode 100644 index 0000000..a5ae8fb --- /dev/null +++ b/docs/TROUBLESHOOTING.md @@ -0,0 +1,21 @@ +# 🔍 Troubleshooting +## Common Issues +### Script won't execute +- Ensure PowerShell execution policy allows scripts +- Verify UAC elevation is working +- Check Windows PowerShell 5.1 is available +- WinGet installation failures + +- Verify internet connectivity +- Check Windows Store app is installed +- Update Windows to latest version +- Bloatware returns after reboot + +- Run script as Administrator +- Ensure all user profiles are processed +- Check Group Policy restrictions +- Offline installers not found + +- Verify installer paths in script +- Check file permissions on USB drive +- Ensure installers support silent installation From 193b051c17f3fbad57c8bbcc0928df3de694949e Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:53:13 -0700 Subject: [PATCH 23/37] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cbb7a1f..09ebef0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to DeployWorkstation +# Contributing to SystemTester -Thank you for your interest in contributing to DeployWorkstation! This document provides guidelines and information for contributors. +Thank you for your interest in contributing to SystemTester! This document provides guidelines and information for contributors. ## 📚 Table of Contents - [🎯 Ways to Contribute](#-ways-to-contribute) From 07802a1bb1ae2c79d47102a3b02e5bf5bbda928a Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:54:12 -0700 Subject: [PATCH 24/37] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cbb7a1f..09ebef0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to DeployWorkstation +# Contributing to SystemTester -Thank you for your interest in contributing to DeployWorkstation! This document provides guidelines and information for contributors. +Thank you for your interest in contributing to SystemTester! This document provides guidelines and information for contributors. ## 📚 Table of Contents - [🎯 Ways to Contribute](#-ways-to-contribute) From ff29f8de85bb7e0e22cd991d983724f01eb57e8e Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:54:24 -0700 Subject: [PATCH 25/37] Delete CONTRIBUTING.md --- CONTRIBUTING.md | 114 ------------------------------------------------ 1 file changed, 114 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 09ebef0..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,114 +0,0 @@ -# Contributing to SystemTester - -Thank you for your interest in contributing to SystemTester! This document provides guidelines and information for contributors. - -## 📚 Table of Contents -- [🎯 Ways to Contribute](#-ways-to-contribute) -- [🔄 Development Process](#-development-process) -- [📋 Code Review Process](#-code-review-process) -- [🏷️ Commit Message Format](#-commit-message-format) -- [🔒 Security Issues](#-security-issues) -- [📞 Getting Help](#-getting-help) -- [🙏 Recognition](#-recognition) - -## 🎯 Ways to Contribute - -### 🐛 Bug Reports -- Use the bug report template -- Include system information and logs -- Provide clear reproduction steps - -### 💡 Feature Requests -- Use the feature request template -- Explain the use case and business value -- Consider implementation complexity - -### 🔧 Code Contributions -- Fork the repository -- Create a feature branch -- Follow PowerShell best practices -- Add tests for new functionality -- Update documentation - -### 📖 Documentation -- Improve README clarity -- Add configuration examples -- Create troubleshooting guides -- Fix typos and formatting - -## 🔄 Development Process - -### Setting Up Development Environment -1. Fork the repository -2. Clone your fork locally -3. Create a feature branch: `git checkout -b feature/your-feature-name` -4. Make your changes -5. Test thoroughly on multiple Windows versions -6. Commit with clear messages -7. Push to your fork -8. Create a pull request - -### PowerShell Style Guidelines -- Use approved verbs for function names -- Follow PascalCase for functions and variables -- Use meaningful variable names -- Include comment-based help for functions -- Handle errors gracefully -- Use Write-Log for consistent logging - -### Testing Requirements -- Test on Windows 10 and 11 -- Test both domain and workgroup environments -- Verify offline functionality -- Check with different hardware configurations -- Use virtual machines or sandbox environments when possible -- Validate behavior with and without admin rights -- Test with missing or partial Sysinternals tools to confirm graceful degradation - -## ✅ Pull Request Checklist -- [ ] Code follows PowerShell style guidelines -- [ ] New functionality includes tests -- [ ] Documentation is updated -- [ ] Changes tested on Windows 10 and 11 -- [ ] No sensitive data included - -## 📋 Code Review Process - -1. **Automated Checks**: PR must pass all automated tests -2. **Manual Review**: Maintainer reviews code and functionality -3. **Testing**: Changes tested in real deployment scenarios -4. **Documentation**: Ensure documentation is updated -5. **Approval**: Maintainer approves and merges PR - -## 🏷️ Commit Message Format - -Use conventional commits format: - -Examples: -- `feat(installer): add support for custom MSI packages` -- `fix(logging): resolve log file permission issues` -- `docs(readme): update installation instructions` -- `test(core): add unit tests for bloatware removal` - -## 🔒 Security Issues - -For security-related issues: -1. **DO NOT** open a public issue -2. Email security@pnwcomputers.com -3. Include proof of concept (if safe) -4. Allow reasonable time for response - -## 📞 Getting Help - -- Check existing issues and documentation -- Join discussions in GitHub Discussions -- Email support@pnwcomputers.com for questions - -## 🙏 Recognition - -Contributors will be recognized in: -- CHANGELOG.md for significant contributions -- README.md for major features -- GitHub contributors page - -We’re excited to collaborate with you! Whether it’s a typo fix or a new feature, your contribution makes a difference. From 1297e804ba47696abe6276e63456003092a08f8b Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:56:09 -0700 Subject: [PATCH 26/37] Update README.md --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48d519f..7017e4e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # 🧰 Portable Sysinternals System Tester v2.2 (FIXED) +![Automation Level](https://img.shields.io/badge/Automation-Zero%20Touch-green) +![Windows Support](https://img.shields.io/badge/Windows-10%20%7C%2011-blue) +![PowerShell Version](https://img.shields.io/badge/PowerShell-5.1%2B-blue) +![Enterprise Ready](https://img.shields.io/badge/Enterprise-Ready-purple) +![GitHub issues](https://img.shields.io/github/issues/Pnwcomputers/SystemTester) +![Maintenance](https://img.shields.io/badge/Maintained-Yes-green) + **Thumb-drive friendly, no-install Windows hardware health check toolkit** powered by **Sysinternals** and **PowerShell**. A zero-dependency **PowerShell solution** that runs a comprehensive, curated set of Sysinternals and Windows diagnostic tools. It then processes the raw data to produce two essential reports: a **Clean Summary Report** (human-readable, de-noised, with recommendations) and a **Detailed Report** (cleaned tool outputs). @@ -543,7 +550,6 @@ For security vulnerabilities or sensitive findings: - ✅ Fixed memory leak in Windows Update test ### v2.2 (Original) - January 2025 -- ⚠️ Known issues - use FIXED version instead - Added GPU testing enhancements - Added tool integrity verification - Added dual report system @@ -560,6 +566,22 @@ For security vulnerabilities or sensitive findings: --- +## 📊 Statistics + +![GitHub stars](https://img.shields.io/github/stars/Pnwcomputers/SystemTester) +![GitHub forks](https://img.shields.io/github/forks/Pnwcomputers/SystemTester) +![GitHub issues](https://img.shields.io/github/issues/Pnwcomputers/SystemTester) +![GitHub license](https://img.shields.io/github/license/Pnwcomputers/SystemTester) + +**🎯 Transform your Windows deployment process from hours to minutes!** + +Built with ❤️ for efficiency, reliability, and zero-touch automation. + +[⭐ Star this repo](https://github.com/Pnwcomputers/SystemTester) if it saved you time and effort! + +--- + +*Tested on Windows 10 (1909+) and Windows 11 - Enterprise, Pro, and Home editions* **Last Updated:** January 2025 | **Version:** 2.2 (FIXED) | **Status:** Production Ready **⚠️ IMPORTANT:** Always use the `_FIXED` versions of the files for proper operation. From 34551673359e771229c605e7d32ac547424c3ac4 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:57:17 -0700 Subject: [PATCH 27/37] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7017e4e..d315396 100644 --- a/README.md +++ b/README.md @@ -573,9 +573,9 @@ For security vulnerabilities or sensitive findings: ![GitHub issues](https://img.shields.io/github/issues/Pnwcomputers/SystemTester) ![GitHub license](https://img.shields.io/github/license/Pnwcomputers/SystemTester) -**🎯 Transform your Windows deployment process from hours to minutes!** +**🎯 Transform your Windows diagnostics from a step-by-step process to AUTOMATED with FULL REPORTING!** -Built with ❤️ for efficiency, reliability, and zero-touch automation. +Built with ❤️ for efficiency, reliability, and a goal of close to zero-touch automation. [⭐ Star this repo](https://github.com/Pnwcomputers/SystemTester) if it saved you time and effort! From 07d6008ecf28f72fef84e688d9c970295c026ac5 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:59:59 -0700 Subject: [PATCH 28/37] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d315396..1dc227d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Version 2.2 introduces comprehensive GPU testing capabilities and fixes several * 🧹 **Output Cleaner** — removes banners, EULA text, usage blocks for readable reports * 🧠 **Comprehensive Tests** — CPU, RAM, Disk, GPU, Network, OS Health, Windows Update status * 🎮 **Enhanced GPU Testing** — Multi-GPU support, NVIDIA/AMD vendor tools, display configuration +* 📝 **Enhanced Network Testing** — Link status, speed, MAC addresses, etc * 🔧 **Tool Integrity Verification** — Digital signature checking for Sysinternals tools * 🗂️ **Smart Reporting** — timestamped **Summary** + **Detailed** TXT reports with actionable recommendations * 📦 **Fully Portable** — run from USB; no installation required From f1f9df913468d87c1e177aa5084f9f847dcaeecb Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:49:44 -0700 Subject: [PATCH 29/37] Update README.md --- README.md | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1dc227d..2f42646 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ A zero-dependency **PowerShell solution** that runs a comprehensive, curated set --- -## 🚀 NEW in v2.2: Enhanced GPU Testing & Critical Bug Fixes +## 🚀 NEW in v2.2: Enhanced GPU Testing, Advanced Network Suite & Critical Bug Fixes -Version 2.2 introduces comprehensive GPU testing capabilities and fixes several critical bugs that prevented the script from running properly. +Version 2.2 introduces comprehensive GPU testing capabilities, advanced network speed/latency testing, and fixes several critical bugs that prevented the script from running properly. ### Key New Capabilities: @@ -28,7 +28,8 @@ Version 2.2 introduces comprehensive GPU testing capabilities and fixes several * 🧹 **Output Cleaner** — removes banners, EULA text, usage blocks for readable reports * 🧠 **Comprehensive Tests** — CPU, RAM, Disk, GPU, Network, OS Health, Windows Update status * 🎮 **Enhanced GPU Testing** — Multi-GPU support, NVIDIA/AMD vendor tools, display configuration -* 📝 **Enhanced Network Testing** — Link status, speed, MAC addresses, etc +* 🌐 **Advanced Network Speed Suite** — Complete connectivity, latency, DNS, MTU, and bandwidth testing +* 📝 **Enhanced Network Testing** — Link status, speed, IP/MAC addresses, PSPing integration * 🔧 **Tool Integrity Verification** — Digital signature checking for Sysinternals tools * 🗂️ **Smart Reporting** — timestamped **Summary** + **Detailed** TXT reports with actionable recommendations * 📦 **Fully Portable** — run from USB; no installation required @@ -106,6 +107,7 @@ Version 2.2 introduces comprehensive GPU testing capabilities and fixes several │ ├── pslist.exe │ ├── handle.exe │ ├── autorunsc.exe +│ ├── psping.exe # For advanced network latency testing │ └── ... (60+ other tools) ├── 📂 Tools/ # GPU testing tools (optional) │ └── GPU-Z.exe # Downloaded via Option 6 @@ -156,16 +158,16 @@ For enhanced GPU testing: |---|----------|-------------|----------------| | 1 | **System Information** | OS details, computer info, clock resolution | `psinfo`, `clockres`, CIM queries | | 2 | **CPU Testing** | Architecture, performance benchmarks, top processes | `coreinfo`, stress test, process analysis | -| 3 | **RAM Testing** | Memory capacity, modules, usage patterns | CIM queries, performance counters | -| 4 | **Storage Testing** | Drives, fragmentation, performance, SMART data | `du`, read/write tests | +| 3 | **RAM Testing** | Memory capacity, modules, usage patterns | CIM queries, `testlimit`, performance counters | +| 4 | **Storage Testing** | Drives, fragmentation, performance, SMART data | `du`, `contig`, `streams`, read/write tests | | 5 | **Process Analysis** | Running processes, handles, process tree | `pslist`, `handle` | | 6 | **Security Analysis** | Autorun entries, startup items | `autorunsc` | -| 7 | **Network Analysis** | Active connections, adapter info | `netstat`, `Get-NetAdapter` | +| 7 | **Network Analysis** | Connectivity, latency, DNS, bandwidth, MTU | `netstat`, `Get-NetAdapter`, `psping`, `Test-NetConnection` | | 8 | **OS Health** | System file integrity, component store | `DISM`, `SFC` | -| 9 | **Storage SMART** | Drive health, reliability counters | `Get-PhysicalDisk` | +| 9 | **Storage SMART** | Drive health, reliability counters | `Get-PhysicalDisk`, WMI SMART | | 10 | **SSD TRIM** | TRIM enablement status | `fsutil` | -| 11 | **Network Adapters** | Link status, speed, MAC addresses | `Get-NetAdapter` | -| 12 | **GPU (Enhanced)** | Multi-GPU info, vendor tools, memory | CIM, `dxdiag`, `nvidia-smi` | +| 11 | **Network Adapters** | Link status, speed, IP/MAC addresses | `Get-NetAdapter`, `Get-NetIPConfiguration` | +| 12 | **GPU (Enhanced)** | Multi-GPU info, vendor tools, memory | CIM, `dxdiag`, `nvidia-smi`, GPU-Z | | 12a | **Basic GPU Info** | Details, displays, drivers, DirectX, OpenGL | CIM queries, `dxdiag` | | 12b | **Vendor-Specific** | NVIDIA/AMD metrics, temperatures, utilization | `nvidia-smi`, AMD registry | | 12c | **GPU Memory** | VRAM capacity, usage, performance counters | CIM, performance counters | @@ -173,6 +175,15 @@ For enhanced GPU testing: | 14 | **Hardware Events** | WHEA error logs (last 7 days) | Event Viewer (WHEA-Logger) | | 15 | **Windows Update** | Pending updates, history, service status | Windows Update COM API | +### Network Speed Test Suite (Option 7) Features: + +* **Local Connectivity** — Tests local network and default gateway reachability (`Test-NetConnection`) +* **Internet Reachability** — Connectivity tests to multiple endpoints (Google DNS, Cloudflare DNS, Google.com, Microsoft.com) with port-specific testing (DNS 53, HTTPS 443) +* **Latency Testing** — Detailed ping tests to multiple targets with round-trip time measurements +* **PSPing Integration** — Advanced latency and TCP bandwidth capacity testing for connection quality analysis (requires `psping.exe` in Sysinternals folder) +* **DNS Resolution Speed** — Measures DNS lookup speed for multiple domains in milliseconds +* **Network MTU Discovery** — Checks for standard MTU (1500 bytes) without fragmentation to help identify network configuration issues + --- ## 📊 Sample Output @@ -304,8 +315,8 @@ When you select GPU testing in the PowerShell menu, you can: ### Tests taking too long **Expected:** Some tests are intentionally slow: -- CPU Performance: 30 seconds -- Power/Energy Report: 20 seconds (admin only) +- CPU Performance: 10-30 seconds +- Power/Energy Report: 15-20 seconds (admin only) - Windows Update Search: 30-90 seconds - DISM/SFC Scans: 5-15 minutes each (admin only) - DirectX Diagnostics (dxdiag): Up to 50 seconds @@ -330,6 +341,7 @@ When you select GPU testing in the PowerShell menu, you can: | Feature | Description | | :--- | :--- | +| **Advanced Network Speed Suite** | Complete connectivity, latency, DNS resolution, PSPing bandwidth, and MTU testing | | **Tool Integrity Verification** | Check digital signatures and validate file sizes of Sysinternals tools | | **Enhanced GPU Testing** | Multi-GPU support, vendor-specific tools (NVIDIA/AMD), display configuration | | **GPU Tools Manager** | New batch menu option for managing GPU testing utilities | @@ -358,6 +370,8 @@ When you select GPU testing in the PowerShell menu, you can: * Enhanced recommendations engine with more actionable advice * Improved GPU driver age detection with fallback handling * Better COM object lifecycle management +* Network testing now includes comprehensive connectivity analysis +* PSPing integration for advanced latency and bandwidth testing --- @@ -368,7 +382,7 @@ When you select GPU testing in the PowerShell menu, you can: * Baseline comparison mode (compare current vs. previous tests) * Skip flags (`-SkipCPU`, `-SkipNetwork`, etc.) * CSV export for data analysis -* Network throughput testing (PSPing integration) +* Enhanced network throughput testing (extended PSPing integration) * Memory leak detection * Audio device testing * Intel Arc GPU support @@ -443,6 +457,7 @@ Contributions welcome! Areas of interest: * **Parsers:** New tool output cleaners * **Tests:** Additional diagnostic modules (audio, peripherals, temperatures) * **GPU Tools:** Additional vendor integrations (Intel Arc, etc.) +* **Network Tools:** Additional connectivity and performance tests * **Performance:** Optimization of slow operations * **Documentation:** Tutorial videos, screenshots, wiki articles * **Testing:** Pester unit tests, integration tests @@ -466,6 +481,7 @@ Contributions welcome! Areas of interest: - [ ] Missing Sysinternals tools - [ ] Menu Option 4 (Tool Verification) - [ ] Menu Option 6 (GPU Tools Manager) +- [ ] Network connectivity tests (various network conditions) --- @@ -549,11 +565,13 @@ For security vulnerabilities or sensitive findings: - ✅ Added GPU-Z size validation - ✅ Improved error handling throughout - ✅ Fixed memory leak in Windows Update test +- ✅ Enhanced network testing suite with PSPing integration ### v2.2 (Original) - January 2025 - Added GPU testing enhancements - Added tool integrity verification - Added dual report system +- Added advanced network speed testing ### v2.1 - December 2024 - Fixed memory usage calculation bug @@ -583,6 +601,7 @@ Built with ❤️ for efficiency, reliability, and a goal of close to zero-touch --- *Tested on Windows 10 (1909+) and Windows 11 - Enterprise, Pro, and Home editions* + **Last Updated:** January 2025 | **Version:** 2.2 (FIXED) | **Status:** Production Ready **⚠️ IMPORTANT:** Always use the `_FIXED` versions of the files for proper operation. From 487ee71c56d450e26ec7ba2ea7a28e51996f57b3 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:50:18 -0700 Subject: [PATCH 30/37] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2f42646..b3eeef3 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,8 @@ Version 2.2 introduces comprehensive GPU testing capabilities, advanced network ``` 📂 SystemTester/ -├── 📄 SystemTester_FIXED.ps1 # Main PowerShell script (USE THIS) -├── 📄 SystemTester_FIXED.bat # Batch launcher (USE THIS) +├── 📄 SystemTester.ps1 # Main PowerShell script (USE THIS) +├── 📄 SystemTester.bat # Batch launcher (USE THIS) ├── 📄 README.md # This file ├── 📄 LICENSE # MIT License ├── 📂 Sysinternals/ # Auto-created by launcher @@ -123,7 +123,7 @@ Version 2.2 introduces comprehensive GPU testing capabilities, advanced network ### Option A: Batch Launcher (Recommended) 1. Download or clone this repository -2. Run `SystemTester_FIXED.bat` (will request admin elevation) +2. Run `SystemTester.bat` (will request admin elevation) 3. Choose **Option 5** to auto-download Sysinternals Suite (first time only) 4. Choose **Option 6** to set up GPU testing tools (optional) 5. Choose **Option 1** for interactive menu or **Option 2** to run all tests @@ -133,10 +133,10 @@ Version 2.2 introduces comprehensive GPU testing capabilities, advanced network ```powershell # Interactive menu -powershell -ExecutionPolicy Bypass -File .\SystemTester_FIXED.ps1 +powershell -ExecutionPolicy Bypass -File .\SystemTester.ps1 # Run all tests automatically -powershell -ExecutionPolicy Bypass -File .\SystemTester_FIXED.ps1 -AutoRun +powershell -ExecutionPolicy Bypass -File .\SystemTester.ps1 -AutoRun ``` ### **First-Time Setup** @@ -251,7 +251,7 @@ For detailed output, see: SystemTest_Detailed_20250103_143022.txt ## 🔧 Launcher Menu Options -The batch launcher (`SystemTester_FIXED.bat`) provides: +The batch launcher (`SystemTester.bat`) provides: 1. **Run Interactive Menu** — Select individual tests (includes GPU sub-options) 2. **Run ALL Tests Automatically** — Complete system scan with auto-report @@ -288,10 +288,10 @@ When you select GPU testing in the PowerShell menu, you can: **Solution:** Right-click launcher and choose "Run as administrator" ### Script crashes immediately on startup (v2.2 original only) -**Solution:** ✅ **FIXED** - Use `SystemTester_FIXED.ps1` instead. Original had missing `Initialize-Environment` function. +**Solution:** ✅ **FIXED** - Use `SystemTester.ps1` instead. Original had missing `Initialize-Environment` function. ### Tool verification (Menu Option 4) crashes -**Solution:** ✅ **FIXED** - Use `SystemTester_FIXED.bat` and `SystemTester_FIXED.ps1`. Missing function has been added. +**Solution:** ✅ **FIXED** - Use `SystemTester.bat` and `SystemTester.ps1`. Missing function has been added. ### AMD GPU not detected (multi-GPU systems) **Solution:** ✅ **FIXED** - Script now checks ALL registry subkeys (\0000, \0001, \0002, etc.), not just \0000. From 06eb3c39f3956c5ffcb427ac6cff8da7522666bc Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:54:28 -0700 Subject: [PATCH 31/37] Handle both script names in batch launcher (#3) --- README.md | 2 ++ SystemTester.bat | 25 +++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b3eeef3..250d0dc 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,8 @@ powershell -ExecutionPolicy Bypass -File .\SystemTester.ps1 powershell -ExecutionPolicy Bypass -File .\SystemTester.ps1 -AutoRun ``` +> ℹ️ **Launcher compatibility:** The batch launcher automatically detects either `SystemTester_FIXED.ps1` or the legacy `SystemTester.ps1` filename, so both naming conventions continue to work. + ### **First-Time Setup** If Sysinternals tools are missing: diff --git a/SystemTester.bat b/SystemTester.bat index 5489d6f..129ec3c 100644 --- a/SystemTester.bat +++ b/SystemTester.bat @@ -74,7 +74,17 @@ echo. :: Set paths set "SCRIPT_DIR=%cd%" set "DRIVE_LETTER=%~d0" -set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester.ps1" + +:: Locate PowerShell script (supports legacy and _FIXED names) +set "SCRIPT_PS1=" +set "SCRIPT_PS1_NAME=" +if exist "%SCRIPT_DIR%\SystemTester_FIXED.ps1" ( + set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester_FIXED.ps1" + set "SCRIPT_PS1_NAME=SystemTester_FIXED.ps1" +) else if exist "%SCRIPT_DIR%\SystemTester.ps1" ( + set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester.ps1" + set "SCRIPT_PS1_NAME=SystemTester.ps1" +) :: Check path length for /f %%i in ('powershell -NoProfile -Command "('%SCRIPT_DIR%').Length" 2^>nul') do set "PATH_LENGTH=%%i" @@ -90,15 +100,22 @@ echo Path length: %PATH_LENGTH% characters echo. :: Verify PowerShell script exists -if not exist "%SCRIPT_PS1%" ( - echo [ERROR] PowerShell script not found: %SCRIPT_PS1% +if "%SCRIPT_PS1%"=="" ( + echo [ERROR] PowerShell script not found in: %SCRIPT_DIR% + echo. + echo Expected one of the following files: + echo - SystemTester_FIXED.ps1 + echo - SystemTester.ps1 echo. - echo Ensure SystemTester.ps1 is in the same folder. + echo If you renamed the script, restore one of the supported names. echo. pause exit /b 1 ) +echo Using PowerShell script: %SCRIPT_PS1_NAME% +echo. + :: Check PowerShell version echo Checking PowerShell... for /f "tokens=*" %%v in ('powershell -NoProfile -Command "$PSVersionTable.PSVersion.ToString()" 2^>nul') do set "PS_VERSION=%%v" From 7f7666b4ef24f963d99fde795b45e4fee42a363a Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:55:07 -0700 Subject: [PATCH 32/37] Add network speed and update visibility to reports (#4) --- SystemTester.ps1 | 197 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 196 insertions(+), 1 deletion(-) diff --git a/SystemTester.ps1 b/SystemTester.ps1 index d6f69ff..647a23a 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -501,6 +501,135 @@ function Test-Network { } catch { Write-Host "Error getting network info" -ForegroundColor Red } + + Test-NetworkSpeed + Test-NetworkLatency +} + +function Test-NetworkSpeed { + Write-Host "`n=== Network Speed Test ===" -ForegroundColor Green + + $outputLines = @() + $status = "SUCCESS" + $durationMs = 0 + + # Gather link speed information for active adapters + try { + $adapters = Get-NetAdapter -ErrorAction Stop | Where-Object { $_.Status -eq "Up" } + if ($adapters) { + $outputLines += "Active Link Speeds:" + foreach ($adapter in $adapters) { + $outputLines += " $($adapter.Name): $($adapter.LinkSpeed)" + } + } else { + $outputLines += "Active Link Speeds: No active adapters detected" + } + } catch { + $status = "FAILED" + $outputLines += "Active Link Speeds: Unable to query adapters ($($_.Exception.Message))" + } + + # Perform an outbound download test to estimate internet throughput + $tempFile = $null + try { + $testUrl = "https://speed.hetzner.de/10MB.bin" + $tempFile = [System.IO.Path]::GetTempFileName() + Write-Host "Running internet download test (~10MB)..." -ForegroundColor Yellow + $stopwatch = [System.Diagnostics.Stopwatch]::StartNew() + Invoke-WebRequest -Uri $testUrl -OutFile $tempFile -UseBasicParsing -TimeoutSec 120 | Out-Null + $stopwatch.Stop() + + $fileInfo = Get-Item $tempFile + $sizeBytes = [double]$fileInfo.Length + $duration = [math]::Max($stopwatch.Elapsed.TotalSeconds, 0.001) + $sizeMB = [math]::Round($sizeBytes / 1MB, 2) + $mbps = [math]::Round((($sizeBytes * 8) / 1MB) / $duration, 2) + $mbPerSec = [math]::Round(($sizeBytes / 1MB) / $duration, 2) + + $outputLines += "Internet Download Test:" + $outputLines += " URL: $testUrl" + $outputLines += " File Size: $sizeMB MB" + $outputLines += " Time: $([math]::Round($duration,2)) sec" + $outputLines += " Throughput: $mbps Mbps ($mbPerSec MB/s)" + $durationMs = [math]::Round($stopwatch.Elapsed.TotalMilliseconds) + } catch { + if ($status -ne "FAILED") { $status = "FAILED" } + $outputLines += "Internet Download Test: Failed - $($_.Exception.Message)" + } finally { + if ($tempFile -and (Test-Path $tempFile)) { + Remove-Item $tempFile -ErrorAction SilentlyContinue + } + } + + $script:TestResults += @{ + Tool="Network-SpeedTest"; Description="Local link speed and download throughput" + Status=$status; Output=($outputLines -join "`n"); Duration=$durationMs + } +} + +function Test-NetworkLatency { + Write-Host "`n=== Network Latency (Test-NetConnection & PsPing) ===" -ForegroundColor Green + + $targetHost = "8.8.8.8" + $targetPort = 443 + $lines = @("Target: $targetHost:$targetPort") + $status = "SUCCESS" + + # Built-in Test-NetConnection results + try { + $tnc = Test-NetConnection -ComputerName $targetHost -Port $targetPort -InformationLevel Detailed + if ($tnc) { + $lines += "Test-NetConnection:" + $lines += " Ping Succeeded: $($tnc.PingSucceeded)" + if ($tnc.PingReplyDetails) { + $lines += " Ping RTT: $($tnc.PingReplyDetails.RoundtripTime) ms" + } + $lines += " TCP Succeeded: $($tnc.TcpTestSucceeded)" + } + } catch { + $status = "FAILED" + $lines += "Test-NetConnection: Failed - $($_.Exception.Message)" + } + + # Sysinternals PsPing results + try { + $pspingPath = Join-Path $SysinternalsPath "psping.exe" + if (Test-Path $pspingPath) { + $args = @("-accepteula", "-n", "5", "$targetHost:$targetPort") + Write-Host "Running PsPing latency test..." -ForegroundColor Yellow + $pspingOutput = & $pspingPath $args 2>&1 | Out-String + $lines += "PsPing Summary:" + + $average = $null + $minimum = $null + $maximum = $null + foreach ($line in $pspingOutput -split "`r?`n") { + if ($line -match "Minimum = ([\d\.]+)ms, Maximum = ([\d\.]+)ms, Average = ([\d\.]+)ms") { + $minimum = [double]$matches[1] + $maximum = [double]$matches[2] + $average = [double]$matches[3] + } + } + + if ($average -ne $null) { + $lines += " Min: $minimum ms" + $lines += " Max: $maximum ms" + $lines += " Avg: $average ms" + } else { + $lines += " Unable to parse latency results" + } + } else { + $lines += "PsPing Summary: psping.exe not found in Sysinternals folder" + } + } catch { + $status = "FAILED" + $lines += "PsPing Summary: Failed - $($_.Exception.Message)" + } + + $script:TestResults += @{ + Tool="Network-Latency"; Description="Connectivity latency tests" + Status=$status; Output=($lines -join "`n"); Duration=0 + } } # Test: OS Health @@ -1067,7 +1196,24 @@ function Test-WindowsUpdate { try { $result = $searcher.Search("IsInstalled=0") - $lines += "Pending: $($result.Updates.Count)" + $pendingCount = $result.Updates.Count + $lines += "Pending: $pendingCount" + + if ($pendingCount -gt 0) { + $lines += "Pending Updates:" + $maxList = 10 + for ($i = 0; $i -lt [math]::Min($pendingCount, $maxList); $i++) { + $update = $result.Updates.Item($i) + $classification = ($update.Categories | Select-Object -First 1).Name + if (-not $classification) { $classification = "Unspecified" } + $lines += " - $($update.Title) [$classification]" + } + if ($pendingCount -gt $maxList) { + $lines += " ... ($($pendingCount - $maxList) additional updates not listed)" + } + } else { + $lines += "Pending Updates: None" + } } catch { $lines += "Search failed: $($_.Exception.Message)" } @@ -1171,6 +1317,27 @@ function Generate-Report { } } + $netSpeed = $TestResults | Where-Object {$_.Tool -eq "Network-SpeedTest"} | Select-Object -Last 1 + if ($netSpeed) { + $cleanReport += "" + $cleanReport += "NETWORK SPEED:" + $netSpeed.Output -split "`n" | ForEach-Object { $cleanReport += " $_" } + } + + $netLatency = $TestResults | Where-Object {$_.Tool -eq "Network-Latency"} | Select-Object -Last 1 + if ($netLatency) { + $cleanReport += "" + $cleanReport += "NETWORK LATENCY:" + $netLatency.Output -split "`n" | ForEach-Object { $cleanReport += " $_" } + } + + $updateInfo = $TestResults | Where-Object {$_.Tool -eq "Windows-Update"} | Select-Object -Last 1 + if ($updateInfo) { + $cleanReport += "" + $cleanReport += "WINDOWS UPDATE:" + $updateInfo.Output -split "`n" | ForEach-Object { $cleanReport += " $_" } + } + # ======================================== # ENHANCED RECOMMENDATIONS ENGINE # ======================================== @@ -1228,6 +1395,34 @@ function Generate-Report { } } + # === NETWORK PERFORMANCE === + if ($netSpeed -and $netSpeed.Output -match "Throughput: ([\d\.]+) Mbps") { + $throughputMbps = [float]$matches[1] + if ($throughputMbps -lt 25) { + $recommendations += "• WARNING: Internet throughput appears slow ($throughputMbps Mbps)" + $recommendations += " → Verify ISP plan and router performance" + $recommendations += " → Re-test when fewer applications are consuming bandwidth" + } + } + + if ($netLatency -and $netLatency.Output -match "Avg: ([\d\.]+) ms") { + $avgLatency = [float]$matches[1] + if ($avgLatency -gt 100) { + $recommendations += "• NOTICE: High network latency detected (Avg $avgLatency ms)" + $recommendations += " → Check local network congestion" + $recommendations += " → Contact ISP if latency persists" + } + } + + if ($updateInfo -and $updateInfo.Output -match "Pending: (\d+)") { + $pendingUpdates = [int]$matches[1] + if ($pendingUpdates -gt 0) { + $recommendations += "• ACTION: $pendingUpdates Windows update(s) pending installation" + $recommendations += " → Install updates via Settings > Windows Update" + $recommendations += " → Reboot system after installation completes" + } + } + # === STORAGE CAPACITY === $storageInfo = $TestResults | Where-Object {$_.Tool -eq "Storage-Overview"} if ($storageInfo) { From 386d7dcf00dc270cc493c042e8b2281701a4d483 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:55:40 -0700 Subject: [PATCH 33/37] Improve GPU detection and batch reliability (#5) --- SystemTester.bat | 63 ++++++++++++++++++--------- SystemTester.ps1 | 111 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 122 insertions(+), 52 deletions(-) diff --git a/SystemTester.bat b/SystemTester.bat index 129ec3c..fa0e33f 100644 --- a/SystemTester.bat +++ b/SystemTester.bat @@ -241,7 +241,14 @@ echo. pause echo. :: Call the PowerShell function for tool verification -powershell -NoProfile -ExecutionPolicy Bypass -Command ". '%SCRIPT_PS1%'; Test-ToolVerification" +powershell -NoProfile -ExecutionPolicy Bypass -Command "try { . '%SCRIPT_PS1%'; Test-ToolVerification; exit 0 } catch { Write-Error $_; exit 1 }" +if errorlevel 1 ( + echo. + echo [ERROR] Verification encountered an issue. Review output above. +) else ( + echo. + echo Verification complete. +) echo. pause goto MENU @@ -294,6 +301,13 @@ echo Extracting... if not exist "%SYSINT_DIR%" mkdir "%SYSINT_DIR%" powershell -NoProfile -ExecutionPolicy Bypass -Command "Expand-Archive -Path '%ZIP_FILE%' -DestinationPath '%SYSINT_DIR%' -Force; Write-Host 'Extracted successfully' -ForegroundColor Green" +if errorlevel 1 ( + echo [ERROR] Extraction failed. Remove any partial files and retry. + if exist "%ZIP_FILE%" del "%ZIP_FILE%" 2>nul + pause + goto MENU +) + del "%ZIP_FILE%" 2>nul echo. set "TOOL_COUNT=0" @@ -314,6 +328,7 @@ echo. set "GPU_TOOLS_DIR=%SCRIPT_DIR%\Tools" set "GPUZ_PATH=%GPU_TOOLS_DIR%\GPU-Z.exe" set "GPUZ_URL=https://www.techpowerup.com/gpuz/" +set "GPUZ_SIZE=" echo GPU Tools Directory: %GPU_TOOLS_DIR% echo. @@ -331,7 +346,13 @@ echo -------------------------------------------------------- echo INSTALLED TOOLS: echo -------------------------------------------------------- if exist "%GPUZ_PATH%" ( - echo [OK] GPU-Z.exe - Installed + for %%A in ("%GPUZ_PATH%") do set "GPUZ_SIZE=%%~zA" + if not defined GPUZ_SIZE set "GPUZ_SIZE=0" + if !GPUZ_SIZE! LSS 500000 ( + echo [!] GPU-Z.exe - File appears incomplete (!GPUZ_SIZE! bytes) + ) else ( + echo [OK] GPU-Z.exe - Installed (!GPUZ_SIZE! bytes) + ) ) else ( echo [ ] GPU-Z.exe - Not installed ) @@ -343,13 +364,11 @@ if exist "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" ( ) :: Check for AMD tools -set "AMD_FOUND=" -for %%R in ("HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000") do ( - reg query %%R /v DriverDesc 2>nul | find /i "AMD" >nul 2>&1 - if not errorlevel 1 set "AMD_FOUND=YES" -) -if defined AMD_FOUND ( - echo [OK] AMD GPU Drivers - Installed +set "AMD_COUNT=" +for /f %%A in ('powershell -NoProfile -Command "(Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match '^\d{4}$' } | ForEach-Object { Get-ItemProperty $_.PsPath -ErrorAction SilentlyContinue } | Where-Object { $_.DriverDesc -match 'AMD|Radeon' }).Count" 2^>nul') do set "AMD_COUNT=%%A" +if not defined AMD_COUNT set "AMD_COUNT=0" +if not "!AMD_COUNT!"=="0" ( + echo [OK] AMD GPU Drivers - Detected (!AMD_COUNT! device^(s^)) ) else ( echo [ ] AMD GPU Drivers - Not detected ) @@ -378,7 +397,14 @@ if exist "%GPUZ_PATH%" ( echo GPU-Z is already installed at: echo %GPUZ_PATH% echo. - for %%A in ("%GPUZ_PATH%") do echo Size: %%~zA bytes + set "GPUZ_SIZE=" + for %%A in ("%GPUZ_PATH%") do set "GPUZ_SIZE=%%~zA" + if not defined GPUZ_SIZE set "GPUZ_SIZE=0" + echo Size: !GPUZ_SIZE! bytes + if !GPUZ_SIZE! LSS 500000 ( + echo WARNING: File size is unusually small. Re-download recommended. + echo. + ) echo. set /p "run_gpuz=Run GPU-Z now? (Y/N): " if /i "!run_gpuz!"=="Y" ( @@ -483,21 +509,16 @@ echo ======================================================== echo. :: Check for AMD GPU -set "AMD_FOUND=" -set "AMD_NAME=" -for /f "tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverDesc 2^>nul ^| find "DriverDesc"') do ( - set "AMD_NAME=%%b" - echo %%b | find /i "AMD" >nul 2>&1 - if not errorlevel 1 set "AMD_FOUND=YES" -) +set "AMD_COUNT=" +for /f %%A in ('powershell -NoProfile -Command "(Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match '^\d{4}$' } | ForEach-Object { Get-ItemProperty $_.PsPath -ErrorAction SilentlyContinue } | Where-Object { $_.DriverDesc -match 'AMD|Radeon' }).Count" 2^>nul') do set "AMD_COUNT=%%A" +if not defined AMD_COUNT set "AMD_COUNT=0" -if defined AMD_FOUND ( - echo [OK] AMD GPU Detected: %AMD_NAME% +if not "!AMD_COUNT!"=="0" ( + echo [OK] AMD GPU Detected: !AMD_COUNT! device^(s^) echo. echo AMD Driver Information: echo ======================================================== - reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverVersion 2>nul - reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v DriverDate 2>nul + powershell -NoProfile -Command "Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match '^\d{4}$' } | ForEach-Object { $info = Get-ItemProperty $_.PsPath -ErrorAction SilentlyContinue; if ($info.DriverDesc -match 'AMD|Radeon') { '{0}: {1}' -f $_.PSChildName,$info.DriverDesc; if ($info.DriverVersion) { ' Driver Version: {0}' -f $info.DriverVersion }; if ($info.DriverDate) { ' Driver Date: {0}' -f $info.DriverDate }; '' } }" echo ======================================================== echo. echo NOTE: AMD doesn't provide a command-line tool like diff --git a/SystemTester.ps1 b/SystemTester.ps1 index 647a23a..5842d24 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -699,10 +699,21 @@ function Test-Trim { } $txt = $map.GetEnumerator() | ForEach-Object { $status = if ($_.Value -eq "0") { "Enabled" } else { "Disabled" } - "$($_.Key): $status" + "$($_.Key): TRIM $status" } if (-not $txt) { $txt = @("TRIM status unknown") } + if ($map.Count -gt 0) { + $enabledCount = ($map.GetEnumerator() | Where-Object { $_.Value -eq "0" }).Count + if ($enabledCount -eq $map.Count) { + $txt += "Overall: TRIM is ENABLED" + } elseif ($enabledCount -eq 0) { + $txt += "Overall: TRIM is DISABLED" + } else { + $txt += "Overall: TRIM mixed (check per-filesystem status)" + } + } + $script:TestResults += @{ Tool="SSD-TRIM"; Description="TRIM status" Status="SUCCESS"; Output=($txt -join "`n"); Duration=50 @@ -971,17 +982,25 @@ function Test-GPU { $gpus = Get-CimInstance Win32_VideoController foreach ($gpu in $gpus) { if ($gpu.Name) { - $year = if ($gpu.DriverDate) { - ([DateTime]$gpu.DriverDate).Year - } else { - 2020 + $driverYear = $null + if ($gpu.DriverDate) { + try { + $driverYear = ([DateTime]$gpu.DriverDate).Year + } catch { + $driverYear = $null + } } - - $featureLevel = if ($year -ge 2020) { "12_x" } - elseif ($year -ge 2016) { "12_0" } - elseif ($year -ge 2012) { "11_0" } + + if (-not $driverYear) { + # Fall back to a conservative default if parsing fails + $driverYear = 2014 + } + + $featureLevel = if ($driverYear -ge 2020) { "12_x" } + elseif ($driverYear -ge 2016) { "12_0" } + elseif ($driverYear -ge 2012) { "11_0" } else { "10_x" } - + $capabilities += "$($gpu.Name): Likely supports DirectX $featureLevel" } } @@ -1036,23 +1055,43 @@ function Test-GPUVendorSpecific { # Check for AMD try { - $amdRegistry = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" - - if (Test-Path $amdRegistry) { - $amdInfo = Get-ItemProperty $amdRegistry -ErrorAction Stop - - $amdOutput = @() - $amdOutput += "AMD GPU Detected" - $amdOutput += "Driver Description: $($amdInfo.DriverDesc)" - $amdOutput += "Driver Version: $($amdInfo.DriverVersion)" - $amdOutput += "Driver Date: $($amdInfo.DriverDate)" - - if ($amdInfo.DriverDesc -match "AMD|Radeon") { + $amdClassRoot = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" + + if (Test-Path $amdClassRoot) { + $amdOutputs = @() + $detected = $false + + $subKeys = Get-ChildItem $amdClassRoot -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match "^\d{4}$" } + foreach ($subKey in $subKeys) { + try { + $amdInfo = Get-ItemProperty $subKey.PSPath -ErrorAction Stop + } catch { + continue + } + + if ($amdInfo.DriverDesc -and $amdInfo.DriverDesc -match "AMD|Radeon") { + $detected = $true + $amdOutputs += "AMD GPU Slot $($subKey.PSChildName)" + $amdOutputs += "Driver Description: $($amdInfo.DriverDesc)" + if ($amdInfo.DeviceDesc) { $amdOutputs += "Device: $($amdInfo.DeviceDesc)" } + if ($amdInfo.DriverVersion) { $amdOutputs += "Driver Version: $($amdInfo.DriverVersion)" } + if ($amdInfo.DriverDate) { $amdOutputs += "Driver Date: $($amdInfo.DriverDate)" } + $amdOutputs += "" + } + } + + if ($detected) { $script:TestResults += @{ Tool="AMD-GPU"; Description="AMD GPU information" - Status="SUCCESS"; Output=($amdOutput -join "`n"); Duration=100 + Status="SUCCESS"; Output=($amdOutputs -join "`n"); Duration=150 } Write-Host "AMD GPU information collected" -ForegroundColor Green + } else { + Write-Host "AMD GPU not detected" -ForegroundColor DarkGray + $script:TestResults += @{ + Tool="AMD-GPU"; Description="AMD GPU information" + Status="SKIPPED"; Output="No AMD GPU detected"; Duration=0 + } } } else { Write-Host "AMD GPU not detected" -ForegroundColor DarkGray @@ -1181,6 +1220,8 @@ function Test-HardwareEvents { function Test-WindowsUpdate { Write-Host "`n=== Windows Update ===" -ForegroundColor Green $updateSession = $null + $searcher = $null + $result = $null try { $lines = @() try { @@ -1226,6 +1267,12 @@ function Test-WindowsUpdate { } catch { Write-Host "Windows Update check failed" -ForegroundColor Yellow } finally { + if ($result) { + try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($result) | Out-Null } catch {} + } + if ($searcher) { + try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($searcher) | Out-Null } catch {} + } if ($updateSession) { try { [System.Runtime.InteropServices.Marshal]::ReleaseComObject($updateSession) | Out-Null } catch {} } @@ -1533,14 +1580,16 @@ function Generate-Report { # === GPU HEALTH === if ($gpuDetails) { - if ($gpuDetails.Output -match "Driver Date:.*(\d{4})") { - $driverYear = [int]$matches[1] - $currentYear = (Get-Date).Year - if ($currentYear - $driverYear -gt 1) { - $recommendations += "• INFO: GPU drivers are over 1 year old" - $recommendations += " → Update to latest drivers for best performance" - $recommendations += " → NVIDIA: GeForce Experience or nvidia.com" - $recommendations += " → AMD: amd.com/en/support" + if ($gpuDetails.Output -match "Driver Date:.*?(\d{4})") { + $driverYear = 0 + if ([int]::TryParse($matches[1], [ref]$driverYear)) { + $currentYear = (Get-Date).Year + if ($currentYear - $driverYear -gt 1) { + $recommendations += "• INFO: GPU drivers are over 1 year old" + $recommendations += " → Update to latest drivers for best performance" + $recommendations += " → NVIDIA: GeForce Experience or nvidia.com" + $recommendations += " → AMD: amd.com/en/support" + } } } } From d47b6f8948fcf1680f5abc530aa37ebf795acc2a Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:03:33 -0700 Subject: [PATCH 34/37] Handle tool verification exit statuses (#6) --- SystemTester.bat | 15 +++++++++------ SystemTester.ps1 | 20 ++++++++++++++++++-- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/SystemTester.bat b/SystemTester.bat index fa0e33f..38b7efb 100644 --- a/SystemTester.bat +++ b/SystemTester.bat @@ -241,13 +241,16 @@ echo. pause echo. :: Call the PowerShell function for tool verification -powershell -NoProfile -ExecutionPolicy Bypass -Command "try { . '%SCRIPT_PS1%'; Test-ToolVerification; exit 0 } catch { Write-Error $_; exit 1 }" -if errorlevel 1 ( - echo. - echo [ERROR] Verification encountered an issue. Review output above. +powershell -NoProfile -ExecutionPolicy Bypass -Command "try { . ""%SCRIPT_PS1%""; if (-not (Test-ToolVerification)) { exit 2 } else { exit 0 } } catch { Write-Error $_; exit 1 }" +set "VERIFY_CODE=%errorlevel%" +echo. +if "%VERIFY_CODE%"=="0" ( + echo Verification complete. All tools validated successfully. +) else if "%VERIFY_CODE%"=="2" ( + echo [WARNING] Verification completed with issues detected. Review output above. + echo Use Menu Option 5 to re-download the Sysinternals Suite. ) else ( - echo. - echo Verification complete. + echo [ERROR] Verification encountered an issue. Review output above. ) echo. pause diff --git a/SystemTester.ps1 b/SystemTester.ps1 index 5842d24..19b9ebe 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -119,6 +119,9 @@ function Test-ToolVerification { foreach ($tool in $allTools) { $result = Test-ToolIntegrity -ToolName $tool + if (-not $stats.ContainsKey($result.Status)) { + $stats[$result.Status] = 0 + } $stats[$result.Status]++ $color = switch ($result.Status) { @@ -160,15 +163,28 @@ function Test-ToolVerification { Write-Host "" $totalIssues = $stats.BAD_SIZE + $stats.BAD_SIGNATURE + $stats.MISSING + $stats.CHECK_FAILED - if ($totalIssues -eq 0 -and $stats.VALID_MS -gt 0) { + if ($totalIssues -eq 0 -and ($stats.VALID_MS + $stats.VALID_OTHER + $stats.NOT_SIGNED) -gt 0) { Write-Host "STATUS: All present tools are verified and safe to use" -ForegroundColor Green - } elseif ($totalIssues -gt 0) { + Write-Host "" + return $true + } + + if ($totalIssues -gt 0) { Write-Host "STATUS: $totalIssues issue(s) detected - recommend re-download" -ForegroundColor Yellow if ($script:LaunchedViaBatch) { Write-Host "ACTION: Use Batch Menu Option 5 to re-download tools" -ForegroundColor Yellow } + Write-Host "" + return $false + } + + Write-Host "STATUS: No tools were successfully verified" -ForegroundColor Yellow + Write-Host " Ensure Sysinternals Suite is installed" -ForegroundColor Yellow + if ($script:LaunchedViaBatch) { + Write-Host "ACTION: Use Batch Menu Option 5 to download tools" -ForegroundColor Yellow } Write-Host "" + return $false } # Initialize environment From 96e955dc7b2524af6df90fb11448bbf984e6b234 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:06:18 -0700 Subject: [PATCH 35/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 250d0dc..14b9f52 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🧰 Portable Sysinternals System Tester v2.2 (FIXED) +# 🧰 Portable Sysinternals System Tester v2.21 (BLEEDING EDGE - TRIAL) ![Automation Level](https://img.shields.io/badge/Automation-Zero%20Touch-green) ![Windows Support](https://img.shields.io/badge/Windows-10%20%7C%2011-blue) From 2c4c029edabf9b2d15c0d6f7b629afa6542c1939 Mon Sep 17 00:00:00 2001 From: Pacific Northwest Computers <142192730+Pnwcomputers@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:06:56 -0700 Subject: [PATCH 36/37] Fix host:port string interpolation in latency test (#7) --- SystemTester.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SystemTester.ps1 b/SystemTester.ps1 index 19b9ebe..d2a0fc2 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -588,7 +588,7 @@ function Test-NetworkLatency { $targetHost = "8.8.8.8" $targetPort = 443 - $lines = @("Target: $targetHost:$targetPort") + $lines = @("Target: $($targetHost):$targetPort") $status = "SUCCESS" # Built-in Test-NetConnection results @@ -611,7 +611,7 @@ function Test-NetworkLatency { try { $pspingPath = Join-Path $SysinternalsPath "psping.exe" if (Test-Path $pspingPath) { - $args = @("-accepteula", "-n", "5", "$targetHost:$targetPort") + $args = @("-accepteula", "-n", "5", "{0}:{1}" -f $targetHost, $targetPort) Write-Host "Running PsPing latency test..." -ForegroundColor Yellow $pspingOutput = & $pspingPath $args 2>&1 | Out-String $lines += "PsPing Summary:" From 854a7f4fa0c3c7f11e2df1848323594737267f36 Mon Sep 17 00:00:00 2001 From: Pnwcomputers Date: Fri, 31 Oct 2025 12:23:13 -0700 Subject: [PATCH 37/37] refactor: use approved verbs and fix analyzer issues - Clean-ToolOutput -> Convert-ToolOutput (+call site) - Run-Tool -> Invoke-Tool (+call sites) - Generate-Report -> New-Report (+call sites) - Replace param with (alias Args) - Avoid automatic var in PsPing - Fix comparison order - Remove unused var - Repair GPU submenu strings causing parse error --- SystemTester.ps1 | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/SystemTester.ps1 b/SystemTester.ps1 index d2a0fc2..c42b564 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -245,7 +245,7 @@ function Initialize-Environment { } # Clean tool output -function Clean-ToolOutput { +function Convert-ToolOutput { param([string]$ToolName, [string]$RawOutput) if (!$RawOutput) { return "" } @@ -284,10 +284,11 @@ function Clean-ToolOutput { } # Run tool -function Run-Tool { +function Invoke-Tool { param( [string]$ToolName, - [string]$Args = "", + [Alias('Args')] + [string]$ArgumentList = "", [string]$Description = "", [bool]$RequiresAdmin = $false ) @@ -311,13 +312,13 @@ function Run-Tool { try { $start = Get-Date if ($ToolName -in @("psinfo","pslist","handle","autorunsc","testlimit","contig")) { - $Args = "-accepteula $Args" + $ArgumentList = "-accepteula $ArgumentList" } - $argArray = if ($Args.Trim()) { $Args.Split(' ') | Where-Object { $_ } } else { @() } + $argArray = if ($ArgumentList.Trim()) { $ArgumentList.Split(' ') | Where-Object { $_ } } else { @() } $rawOutput = & $toolPath $argArray 2>&1 | Out-String $duration = ((Get-Date) - $start).TotalMilliseconds - $cleanOutput = Clean-ToolOutput -ToolName $ToolName -RawOutput $rawOutput + $cleanOutput = Convert-ToolOutput -ToolName $ToolName -RawOutput $rawOutput $script:TestResults += @{ Tool=$ToolName; Description=$Description @@ -337,8 +338,8 @@ function Run-Tool { # Test: System Info function Test-SystemInfo { Write-Host "`n=== System Information ===" -ForegroundColor Green - Run-Tool -ToolName "psinfo" -Args "-h -s -d" -Description "System information" - Run-Tool -ToolName "clockres" -Description "Clock resolution" + Invoke-Tool -ToolName "psinfo" -ArgumentList "-h -s -d" -Description "System information" + Invoke-Tool -ToolName "clockres" -Description "Clock resolution" try { $os = Get-CimInstance Win32_OperatingSystem -ErrorAction Stop @@ -364,7 +365,7 @@ RAM: $([math]::Round($cs.TotalPhysicalMemory/1GB,2)) GB # Test: CPU function Test-CPU { Write-Host "`n=== CPU Testing ===" -ForegroundColor Green - Run-Tool -ToolName "coreinfo" -Args "-v -f -c" -Description "CPU architecture" + Invoke-Tool -ToolName "coreinfo" -ArgumentList "-v -f -c" -Description "CPU architecture" try { $cpu = Get-CimInstance Win32_Processor -ErrorAction Stop | Select-Object -First 1 @@ -458,7 +459,7 @@ function Test-Storage { Write-Host "Error getting storage info" -ForegroundColor Red } - Run-Tool -ToolName "du" -Args "-l 2 C:\" -Description "Disk usage C:" + Invoke-Tool -ToolName "du" -ArgumentList "-l 2 C:\" -Description "Disk usage C:" # Disk performance test Write-Host "Running disk test..." -ForegroundColor Yellow @@ -473,7 +474,7 @@ function Test-Storage { $writeTime = ((Get-Date) - $writeStart).TotalMilliseconds $readStart = Get-Date - $content = Get-Content $testFile -Raw -ErrorAction Stop + $null = Get-Content $testFile -Raw -ErrorAction Stop $readTime = ((Get-Date) - $readStart).TotalMilliseconds Remove-Item $testFile -ErrorAction Stop @@ -494,14 +495,14 @@ function Test-Storage { # Test: Processes function Test-Processes { Write-Host "`n=== Process Analysis ===" -ForegroundColor Green - Run-Tool -ToolName "pslist" -Args "-t" -Description "Process tree" - Run-Tool -ToolName "handle" -Args "-p explorer" -Description "Explorer handles" + Invoke-Tool -ToolName "pslist" -ArgumentList "-t" -Description "Process tree" + Invoke-Tool -ToolName "handle" -ArgumentList "-p explorer" -Description "Explorer handles" } # Test: Security function Test-Security { Write-Host "`n=== Security Analysis ===" -ForegroundColor Green - Run-Tool -ToolName "autorunsc" -Args "-a -c" -Description "Autorun entries" -RequiresAdmin $true + Invoke-Tool -ToolName "autorunsc" -ArgumentList "-a -c" -Description "Autorun entries" -RequiresAdmin $true } # Test: Network @@ -611,9 +612,9 @@ function Test-NetworkLatency { try { $pspingPath = Join-Path $SysinternalsPath "psping.exe" if (Test-Path $pspingPath) { - $args = @("-accepteula", "-n", "5", "{0}:{1}" -f $targetHost, $targetPort) + $pspingArgs = @("-accepteula", "-n", "5", "{0}:{1}" -f $targetHost, $targetPort) Write-Host "Running PsPing latency test..." -ForegroundColor Yellow - $pspingOutput = & $pspingPath $args 2>&1 | Out-String + $pspingOutput = & $pspingPath $pspingArgs 2>&1 | Out-String $lines += "PsPing Summary:" $average = $null @@ -627,7 +628,7 @@ function Test-NetworkLatency { } } - if ($average -ne $null) { + if ($null -ne $average) { $lines += " Min: $minimum ms" $lines += " Max: $maximum ms" $lines += " Avg: $average ms" @@ -1298,7 +1299,7 @@ function Test-WindowsUpdate { # Generate Dual Reports (Clean + Detailed) - ENHANCED VERSION # Replace the entire Generate-Report function in SystemTester.ps1 (around line 1260) -function Generate-Report { +function New-Report { Write-Host "`nGenerating reports..." -ForegroundColor Cyan # Test write access @@ -1737,9 +1738,14 @@ function Show-Menu { Write-Host "10. SSD TRIM Status" Write-Host "11. Network Adapters" Write-Host "12. GPU (Enhanced)" -ForegroundColor Cyan + <# Write-Host " └─ 12a. Basic GPU Info" Write-Host " └─ 12b. Vendor-Specific (NVIDIA/AMD)" Write-Host " └─ 12c. GPU Memory Test" + #> + Write-Host " - 12a. Basic GPU Info" + Write-Host " - 12b. Vendor-Specific (NVIDIA/AMD)" + Write-Host " - 12c. GPU Memory Test" Write-Host "13. Power/Battery" Write-Host "14. Hardware Events (WHEA)" Write-Host "15. Windows Update" @@ -1802,7 +1808,7 @@ function Start-Menu { Write-Host "`nAll tests complete!" -ForegroundColor Green Read-Host "Press Enter" } - "17" { Generate-Report; Read-Host "`nPress Enter" } + "17" { New-Report; Read-Host "`nPress Enter" } "18" { $script:TestResults = @(); Write-Host "Cleared" -ForegroundColor Green; Start-Sleep 1 } "Q" { return } "q" { return } @@ -1833,7 +1839,7 @@ if ($MyInvocation.InvocationName -ne '.') { Test-StorageSMART; Test-Trim; Test-NIC Test-GPU; Test-GPUVendorSpecific; Test-GPUMemory Test-Power; Test-HardwareEvents; Test-WindowsUpdate - Generate-Report + New-Report Write-Host "`nAuto-run complete!" -ForegroundColor Green Read-Host "Press Enter to exit" } else {