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**. diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 95% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md index cbb7a1f..09ebef0 100644 --- a/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) 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. 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. 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 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. 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. 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. diff --git a/Config/.gitkeep b/Config/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Config/.gitkeep @@ -0,0 +1 @@ + diff --git a/README.md b/README.md index d0840e1..14b9f52 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# ๐Ÿงฐ Portable Sysinternals System Tester v2.2 +# ๐Ÿงฐ 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) +![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**. @@ -11,9 +18,9 @@ A zero-dependency **PowerShell solution** that runs a comprehensive, curated set --- -## ๐Ÿš€ NEW in v2.2: Advanced Network Speed & Latency Testing +## ๐Ÿš€ NEW in v2.2: Enhanced GPU Testing, Advanced Network Suite & Critical Bug Fixes -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 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: @@ -21,6 +28,9 @@ 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 +* ๐ŸŒ **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 * ๐Ÿงฐ **Graceful Degradation** โ€” missing tools detected and skipped automatically with helpful messages @@ -28,7 +38,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 +97,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.ps1 # Main PowerShell script (USE THIS) +โ”œโ”€โ”€ ๐Ÿ“„ SystemTester.bat # Batch launcher (USE THIS) โ”œโ”€โ”€ ๐Ÿ“„ README.md # This file โ”œโ”€โ”€ ๐Ÿ“„ LICENSE # MIT License โ”œโ”€โ”€ ๐Ÿ“‚ Sysinternals/ # Auto-created by launcher @@ -57,6 +107,7 @@ Version 2.2 introduces a complete **Network Speed Test Suite** (Menu Option 8) f โ”‚ โ”œโ”€โ”€ 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 @@ -88,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: @@ -111,11 +164,11 @@ For enhanced GPU testing: | 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 | **FULL Network Analysis** | Active connections, adapter info | `netstat`, `Get-NetAdapter`, `psping`,`Test-NetConncetion` | +| 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`, WMI SMART | | 10 | **SSD TRIM** | TRIM enablement status | `fsutil` | -| 11 | **Network Adapters** | Link status, speed, IP addresses | `Get-NetAdapter`, `Get-NetIPConfiguration` | +| 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 | @@ -124,6 +177,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 @@ -131,7 +193,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 +236,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 @@ -195,12 +258,12 @@ 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 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 +273,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 +289,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.ps1` instead. Original had missing `Initialize-Environment` function. + +### Tool verification (Menu Option 4) crashes +**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. + +### 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 +313,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: 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 45 seconds +- DirectX Diagnostics (dxdiag): Up to 50 seconds --- @@ -254,21 +333,47 @@ 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. | +| **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 | +| **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 +* Network testing now includes comprehensive connectivity analysis +* PSPing integration for advanced latency and bandwidth testing --- @@ -279,9 +384,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 +* Enhanced network throughput testing (extended PSPing integration) * Memory leak detection * Audio device testing +* Intel Arc GPU support ### Version 3.0 (Long-term) * WPF/WinUI graphical interface option @@ -313,9 +419,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 +431,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,9 +455,11 @@ 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.) +* **Network Tools:** Additional connectivity and performance tests * **Performance:** Optimization of slow operations * **Documentation:** Tutorial videos, screenshots, wiki articles * **Testing:** Pester unit tests, integration tests @@ -360,9 +469,21 @@ 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) +- [ ] Network connectivity tests (various network conditions) --- @@ -400,7 +521,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 +531,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 +553,57 @@ 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 + +--- + +## ๐Ÿ“ 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 +- โœ… 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 +- Added recommendations engine +- Improved report formatting + +### v2.0 - November 2024 +- Complete rewrite with modular functions +- Added interactive menu system +- Added batch launcher + +--- + +## ๐Ÿ“Š 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 diagnostics from a step-by-step process to AUTOMATED with FULL REPORTING!** + +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! --- -**Last Updated:** January 2025 | **Version:** 2.1 | **Status:** Production Ready +*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. diff --git a/SystemTester.bat b/SystemTester.bat index 5489d6f..38b7efb 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" @@ -224,7 +241,17 @@ 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%""; 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 [ERROR] Verification encountered an issue. Review output above. +) echo. pause goto MENU @@ -277,6 +304,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" @@ -297,6 +331,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. @@ -314,7 +349,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 ) @@ -326,13 +367,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 ) @@ -361,7 +400,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" ( @@ -466,21 +512,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 d6f69ff..ec726af 100644 --- a/SystemTester.ps1 +++ b/SystemTester.ps1 @@ -229,7 +229,7 @@ function Initialize-Environment { } # Clean tool output -function Clean-ToolOutput { +function Convert-ToolOutput { param([string]$ToolName, [string]$RawOutput) if (!$RawOutput) { return "" } @@ -271,7 +271,8 @@ function Clean-ToolOutput { function Run-Tool { param( [string]$ToolName, - [string]$Args = "", + [Alias('Args')] + [string]$ArgumentList = "", [string]$Description = "", [bool]$RequiresAdmin = $false ) @@ -321,8 +322,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 @@ -348,7 +349,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 @@ -442,7 +443,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 @@ -457,7 +458,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 @@ -478,14 +479,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 @@ -501,6 +502,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) { + $pspingArgs = @("-accepteula", "-n", "5", "{0}:{1}" -f $targetHost, $targetPort) + Write-Host "Running PsPing latency test..." -ForegroundColor Yellow + $pspingOutput = & $pspingPath $pspingArgs 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 ($null -ne $average) { + $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 @@ -570,10 +700,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 @@ -842,17 +983,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" } } @@ -907,23 +1056,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 @@ -1052,6 +1221,8 @@ function Test-HardwareEvents { function Test-WindowsUpdate { Write-Host "`n=== Windows Update ===" -ForegroundColor Green $updateSession = $null + $searcher = $null + $result = $null try { $lines = @() try { @@ -1067,7 +1238,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)" } @@ -1080,6 +1268,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 {} } @@ -1089,7 +1283,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 @@ -1171,6 +1365,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 +1443,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) { @@ -1338,14 +1581,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" + } } } } @@ -1477,9 +1722,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" @@ -1542,7 +1792,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 } @@ -1573,7 +1823,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 { 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 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 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