A real, working tool produced by a live agentic AI system. It checks the health of a Windows computer and writes a plain-English report. Inspect it, run it, and see the result for yourself.
A single PowerShell script that gathers the most useful health indicators of a Windows computer into one readable report:
| Section | What it reads | Why it's useful |
|---|---|---|
| System overview | Computer name, Windows version, uptime, memory | A snapshot of what you're working with |
| Error events | Last 24h of critical/error events (System & Application logs) | Repeated errors are often the first sign of a conflict |
| Driver health | Device drivers that report a problem code | A broken driver can cause crashes, no sound, no network |
| Failed services | Services set to auto-start that are NOT running | A service that won't start can break an app or feature |
| Disk health | Physical drives and their SMART status | A failing drive is dangerous and preventable |
PowerShell, and click it.System_Health_Report_YYYYMMDD.txt in your current folder.Produced by an agentic AI on request, then reviewed and tested. Here it is in full:
# ============================================================
# WINDOWS SYSTEM HEALTH AUDIT (PowerShell)
# Reads logs + system info, writes a plain-English report.
# READ-ONLY: does not change, delete, or download anything.
# ============================================================
if ((Get-ExecutionPolicy) -match 'Restricted') {
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
}
$reportPath = Join-Path $PWD.Path ("System_Health_Report_" + (Get-Date -Format 'yyyyMMdd_HHmm') + ".txt")
$output = New-Object System.Collections.Generic.List[string]
function Add-Line($text) { $output.Add($text) }
Add-Line "============================================================"
Add-Line " 1. SYSTEM OVERVIEW"
Add-Line "============================================================"
$os = Get-CimInstance Win32_OperatingSystem
$cs = Get-CimInstance Win32_ComputerSystem
Add-Line ("Computer name : " + $cs.Name)
Add-Line ("Windows : " + $os.Caption + " (build " + $os.BuildNumber + ")")
$uptime = (Get-Date) - $os.LastBootUpTime
Add-Line ("Uptime : " + "$($uptime.Days) days, $($uptime.Hours) hours, $($uptime.Minutes) minutes")
$totalMemGB = [math]::Round($os.TotalVisibleMemorySize / 1MB, 1)
$freeMemGB = [math]::Round($os.FreePhysicalMemory / 1MB, 1)
Add-Line ("Memory : " + $freeMemGB + " GB free / " + $totalMemGB + " GB total")
Add-Line ""
Add-Line "============================================================"
Add-Line " 2. CRITICAL / ERROR EVENTS (last 24 hours)"
Add-Line "============================================================"
$since = (Get-Date).AddHours(-24)
foreach ($logName in @('System', 'Application')) {
Add-Line ("--- " + $logName + " log ---")
try {
$events = Get-WinEvent -FilterHashtable @{ LogName = $logName; Level = 1, 2; StartTime = $since } -MaxEvents 20 -ErrorAction SilentlyContinue
if ($events) {
foreach ($e in $events) {
Add-Line (" [" + $e.TimeCreated.ToString('MM/dd HH:mm') + "] " + $e.ProviderName + " (ID " + $e.Id + ")")
Add-Line (" " + $e.Message.Split("`n")[0])
}
} else { Add-Line " No critical/error events in the last 24 hours." }
} catch { Add-Line " (Could not read this log - may require admin rights.)" }
Add-Line ""
}
Add-Line "============================================================"
Add-Line " 3. DEVICE DRIVER HEALTH"
Add-Line "============================================================"
$problemDrivers = Get-CimInstance Win32_PnPEntity -ErrorAction SilentlyContinue |
Where-Object { $_.ConfigManagerErrorCode -and $_.ConfigManagerErrorCode -ne 0 }
if ($problemDrivers) {
foreach ($d in $problemDrivers) {
Add-Line (" [!] " + $d.Name + " (Problem Code " + $d.ConfigManagerErrorCode + ")")
}
Add-Line (" Total drivers with a problem: " + @($problemDrivers).Count)
} else { Add-Line " No device driver problems found. Good." }
Add-Line ""
Add-Line "============================================================"
Add-Line " 4. SERVICES SET TO AUTO-START THAT FAILED"
Add-Line "============================================================"
Add-Line "Services that should start with Windows but are NOT running"
Add-Line "could indicate a conflict or a broken install. Some services"
Add-Line "are expected to stop when idle (updaters, on-demand tools);"
Add-Line "those are filtered out so only real issues are flagged."
Add-Line ""
$benignServices = @('edgeupdate','edgeupdatem','GoogleUpdaterInternalService','GoogleUpdaterService','Intel(R) Platform License Manager Service','MapsBroker','sppsvc','XTU3SERVICE','gupdate','gupdatem')
$allAutoServices = Get-CimInstance Win32_Service -ErrorAction SilentlyContinue |
Where-Object { $_.StartMode -eq 'Auto' -and $_.State -ne 'Running' }
$failedServices = $allAutoServices | Where-Object { $_.Name -notin $benignServices }
if ($failedServices) {
foreach ($s in $failedServices) {
Add-Line (" [!] " + $s.Name + " - " + $s.State)
}
Add-Line (" Total: " + @($failedServices).Count)
} else { Add-Line " No concerning auto-start service failures found." }
Add-Line ""
Add-Line "============================================================"
Add-Line " 5. DISK HEALTH"
Add-Line "============================================================"
try {
$disks = Get-PhysicalDisk -ErrorAction Stop | Select-Object FriendlyName, MediaType, HealthStatus, Size
foreach ($d in $disks) {
$sizeGB = [math]::Round($d.Size / 1GB, 0)
Add-Line (" " + $d.FriendlyName + " [" + $d.MediaType + "] " + $d.HealthStatus + " (" + $sizeGB + " GB)")
}
} catch { Add-Line " (Get-PhysicalDisk not available - needs Win10/Server or admin rights.)" }
Add-Line ""
Add-Line "============================================================"
Add-Line " 6. *** SUMMARY ***"
Add-Line "============================================================"
$problems = 0
if ($problemDrivers) {
Add-Line (" - " + @($problemDrivers).Count + " device driver(s) have a problem.")
$problems += @($problemDrivers).Count
} else { Add-Line " - No device driver problems." }
if ($failedServices) {
Add-Line (" - " + @($failedServices).Count + " auto-start service(s) failed to run.")
$problems += @($failedServices).Count
} else { Add-Line " - All auto-start services are running." }
Add-Line ""
if ($problems -eq 0) {
Add-Line " Looks healthy. No driver or service problems detected."
} else {
Add-Line (" Found " + $problems + " issue(s) to investigate (see sections above).")
}
Add-Line ""
Add-Line "============================================================"
Add-Line "Report generated automatically by an agentic AI assistant."
Add-Line "Saved to: " + $reportPath
Add-Line "============================================================"
$output | Out-File -FilePath $reportPath -Encoding UTF8
Write-Host ""
Write-Host "Done! Report saved to:"
Write-Host " " $reportPath
Write-Host ""
Write-Host "Opening the report for you now..."
Write-Host ""
Start-Process notepad.exe -ArgumentList $reportPath
Read-Host "Press Enter to close"
You don't have to understand every line of the report yourself. A great way to learn — and a real-world example of how agentic AI works — is to paste the report into a chatbot and ask it to interpret it for you.
Quick links: Microsoft Copilot · Google Gemini · ChatGPT