Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 210 additions & 0 deletions Commit_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# πŸ†• Update: Cross-Platform Support β€” v2.0

## πŸ“ What Changed

The Laptop Inspector has been upgraded from a Windows-only tool to a **cross-platform diagnostic solution** that now runs on Windows, Linux, and macOS using PowerShell Core.

---

## ✨ Major Updates

### πŸ”„ PowerShell Core Migration
- **Before:** Windows PowerShell 5.1 (Windows only)
- **After:** PowerShell Core 7.0+ (Windows, Linux, macOS)
- All platform-specific code has been refactored for cross-platform compatibility
- Uses built-in variables: `$IsWindows`, `$IsLinux`, `$IsMacOS` for OS detection

### 🐧 Linux Support
- Full hardware diagnostics on Linux systems
- Detects CPU, RAM, GPU, storage, and network configurations
- Automatic platform-aware system calls
- Works with all major Linux distributions

### 🍎 macOS Support
- Comprehensive hardware audits on Apple Silicon and Intel Macs
- Leverages native macOS command-line tools
- Same feature set as Windows and Linux versions

### πŸ› οΈ Technical Improvements
- Enhanced error handling for cross-platform execution
- Platform-aware command compatibility
- Graceful fallback for platform-specific checks
- Improved exception handling for missing tools

---

## πŸš€ How to Run on Linux

### Step 1: Install PowerShell Core

# For linux devices install this tool for better results
```bash
`sudo apt install smartmontools upower pciutils lshw mokutil`

```
**Ubuntu/Debian:**
```bash
# Add Microsoft repository
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update

# Install PowerShell
sudo apt-get install -y powershell
```

**Fedora/RHEL/CentOS:**
```bash
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo dnf install -y powershell
```

**Alpine:**
```bash
apk add --no-cache powershell
```

**Verify installation:**
```bash
pwsh --version
```

### Step 2: Download the Script

```bash
# Clone the repository
git clone https://github.com/bradleymaina/hwcheck.git
cd hwcheck

# Or download directly
wget https://raw.githubusercontent.com/bradleymaina/hwcheck/main/LaptopInspector_v2.ps1
```

### Step 3: Run the Diagnostic

**Basic scan:**
```bash
pwsh -File ./LaptopInspector_v2.ps1
```

**With elevated privileges** (for complete hardware info):
```bash
sudo pwsh -File ./LaptopInspector_v2.ps1
```

**Custom output directory:**
```bash
pwsh -File ./LaptopInspector_v2.ps1 -OutputDir ./my-reports
```

**Generate CSV for tracking:**
```bash
pwsh -File ./LaptopInspector_v2.ps1 -Csv
```

**Generate JSON for automation:**
```bash
pwsh -File ./LaptopInspector_v2.ps1 -Json
```

**All formats:**
```bash
pwsh -File ./LaptopInspector_v2.ps1 -Csv -Json
```

---

## πŸ“Š Output Format

Reports are automatically generated in `./Reports/` directory:

```
./Reports/
β”œβ”€β”€ inspection_2026-04-27.txt # Plain text (archival)
β”œβ”€β”€ inspection_2026-04-27.html # Beautiful HTML (browser-friendly)
β”œβ”€β”€ inspection_2026-04-27.json # JSON (automation-friendly)
└── inspection_history.csv # CSV history (for tracking)
```

---

## πŸ”§ Linux Troubleshooting

| Issue | Solution |
|-------|----------|
| `pwsh: command not found` | Install PowerShell Core (see Step 1 above) |
| Permission denied | Run with `sudo pwsh -File ./LaptopInspector_v2.ps1` |
| Hardware info shows "N/A" | Requires sudo access for full hardware detection |
| Script won't execute | Use `pwsh -ExecutionPolicy Bypass -File ./LaptopInspector_v2.ps1` |

---

## 🎯 Requirements by Platform

### Windows
- PowerShell 5.1+ (pre-installed) or PowerShell Core 7.0+ (recommended)
- Administrator privileges for full diagnostics

### Linux
- PowerShell Core 7.0+
- `sudo` access for hardware information
- Standard tools: `lscpu`, `free`, `lsblk`, `uname`, `ip`

### macOS
- PowerShell Core 7.0+
- Standard macOS command-line tools

---

## πŸ“¦ Key Features (Cross-Platform)

βœ… CPU, RAM, GPU detection
βœ… Storage diagnostics (SSD/HDD detection)
βœ… Battery health analysis (Windows/Linux)
βœ… Network adapter detection
βœ… Security status checks
βœ… Performance metrics
βœ… Multi-format reports (TXT, HTML, CSV, JSON)
βœ… Automatic OS detection
βœ… Portable β€” no installation required

---

## πŸ”„ Breaking Changes

- **Windows PowerShell 5.1 Support:** Still works, but PowerShell Core 7.0+ is recommended
- **Script filename:** Changed from `LaptopInspector.bat` to `LaptopInspector_v2.ps1` for clarity
- **Parameter handling:** Now uses `-File` parameter with PowerShell directly

---

## πŸš€ Next Steps

1. Install PowerShell Core on your Linux system
2. Download `LaptopInspector_v2.ps1`
3. Run the script: `pwsh -File ./LaptopInspector_v2.ps1`
4. Check reports in `./Reports/` directory

---

## πŸ“ Files Included

- `LaptopInspector_v2.ps1` β€” Main cross-platform diagnostic script
- `LaptopInspector.bat` β€” Windows wrapper (legacy)
- `README.md` β€” Full project documentation
- `LICENSE` β€” MIT License
- `Commit_README.md` β€” This changelog

---

## πŸ”— References

- [PowerShell Core Documentation](https://learn.microsoft.com/powershell/)
- [Install PowerShell on Linux](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-linux)
- [Project Repository](https://github.com/bradleymaina/hwcheck)

---

**Version:** 2.0
**Date:** April 2026
**Compatibility:** Windows 10+ | Ubuntu/Debian | Fedora/RHEL | Alpine | macOS
Loading