{"slug": "diagnose", "title": "Diagnose", "summary": "A developer created a PowerShell script that collects comprehensive PC diagnostics, including CPU, RAM, GPU, storage, OS, motherboard, BIOS, and top processes. The script outputs the data in a structured format for analysis by an AI agent.", "body_md": "| # ============================================================ | |\n| # PC DIAGNOSTICS SCRIPT - Run as Administrator | |\n| # Paste the output back to AI Agent for analysis | |\n| # ============================================================ | |\n| $sep = \"=\" * 50 | |\n| Write-Host $sep | |\n| Write-Host \" PC DIAGNOSTICS REPORT\" | |\n| Write-Host \" $(Get-Date)\" | |\n| Write-Host $sep | |\n| # --- CPU --- | |\n| Write-Host \"`n[CPU]\" | |\n| $cpu = Get-CimInstance Win32_Processor | |\n| Write-Host \"Name : $($cpu.Name)\" | |\n| Write-Host \"Cores : $($cpu.NumberOfCores) physical / $($cpu.NumberOfLogicalProcessors) logical\" | |\n| Write-Host \"Max Speed : $($cpu.MaxClockSpeed) MHz\" | |\n| Write-Host \"Current Load : $($cpu.LoadPercentage)%\" | |\n| # --- Power Plan --- | |\n| Write-Host \"`n[POWER PLAN]\" | |\n| powercfg /getactivescheme | |\n| powercfg /list | |\n| # --- RAM --- | |\n| Write-Host \"`n[RAM]\" | |\n| $sticks = Get-CimInstance Win32_PhysicalMemory | |\n| foreach ($s in $sticks) { | |\n| $gb = [math]::Round($s.Capacity / 1GB, 0) | |\n| Write-Host \"Slot $($s.DeviceLocator): ${gb}GB | Rated: $($s.Speed) MHz | Running: $($s.ConfiguredClockSpeed) MHz | Mfg: $($s.Manufacturer)\" | |\n| } | |\n| $totalRam = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1) | |\n| Write-Host \"Total RAM : ${totalRam} GB\" | |\n| # --- GPU --- | |\n| Write-Host \"`n[GPU]\" | |\n| $gpus = Get-CimInstance Win32_VideoController | |\n| foreach ($g in $gpus) { | |\n| $vram = if ($g.AdapterRAM) { [math]::Round($g.AdapterRAM / 1GB, 1) } else { \"N/A\" } | |\n| Write-Host \"Name : $($g.Name)\" | |\n| Write-Host \"VRAM : ${vram} GB\" | |\n| Write-Host \"Driver Ver : $($g.DriverVersion)\" | |\n| Write-Host \"Resolution : $($g.CurrentHorizontalResolution) x $($g.CurrentVerticalResolution)\" | |\n| } | |\n| # --- Storage --- | |\n| Write-Host \"`n[STORAGE - Physical Disks]\" | |\n| Get-PhysicalDisk | ForEach-Object { | |\n| $sz = [math]::Round($_.Size / 1GB, 0) | |\n| Write-Host \"$($_.FriendlyName) | Type: $($_.MediaType) | ${sz}GB | Health: $($_.HealthStatus)\" | |\n| } | |\n| Write-Host \"`n[STORAGE - Drive Space]\" | |\n| Get-PSDrive -PSProvider FileSystem | ForEach-Object { | |\n| $used = [math]::Round($_.Used / 1GB, 1) | |\n| $free = [math]::Round($_.Free / 1GB, 1) | |\n| Write-Host \"Drive $($_.Name): Used=${used}GB Free=${free}GB\" | |\n| } | |\n| # --- OS (fixed: use CimInstance for proper DateTime) --- | |\n| Write-Host \"`n[OPERATING SYSTEM]\" | |\n| $os = Get-CimInstance Win32_OperatingSystem | |\n| Write-Host \"OS : $($os.Caption) $($os.OSArchitecture)\" | |\n| Write-Host \"Build : $($os.BuildNumber)\" | |\n| $uptime = (Get-Date) - $os.LastBootUpTime | |\n| Write-Host \"Uptime : $([math]::Floor($uptime.TotalHours))h $($uptime.Minutes)m\" | |\n| Write-Host \"Virtual Mem : $([math]::Round($os.TotalVirtualMemorySize / 1MB, 1)) GB\" | |\n| # --- Motherboard / BIOS --- | |\n| Write-Host \"`n[MOTHERBOARD / BIOS]\" | |\n| $mb = Get-CimInstance Win32_BaseBoard | |\n| Write-Host \"Manufacturer : $($mb.Manufacturer)\" | |\n| Write-Host \"Model : $($mb.Product)\" | |\n| $bios = Get-CimInstance Win32_BIOS | |\n| Write-Host \"BIOS Version : $($bios.SMBIOSBIOSVersion)\" | |\n| $biosDate = $bios.ReleaseDate | |\n| Write-Host \"BIOS Date : $($biosDate.ToString('yyyy-MM-dd'))\" | |\n| # --- Top 15 CPU Processes --- | |\n| Write-Host \"`n[TOP 15 CPU PROCESSES]\" | |\n| Get-Process | Sort-Object CPU -Descending | Select-Object -First 15 | ForEach-Object { | |\n| $c = [math]::Round($_.CPU, 1) | |\n| $m = [math]::Round($_.WorkingSet64 / 1MB, 0) | |\n| Write-Host (\" \" + $_.ProcessName.PadRight(32) + \"CPU: ${c}s RAM: ${m}MB\") | |\n| } | |\n| # --- Top 15 RAM Processes --- | |\n| Write-Host \"`n[TOP 15 RAM PROCESSES]\" | |\n| Get-Process | Sort-Object WorkingSet64 -Descending | Select-Object -First 15 | ForEach-Object { | |\n| $m = [math]::Round($_.WorkingSet64 / 1MB, 0) | |\n| Write-Host (\" \" + $_.ProcessName.PadRight(32) + \"RAM: ${m}MB\") | |\n| } | |\n| # --- Network (show all present adapters, not just Up) --- | |\n| Write-Host \"`n[NETWORK ADAPTERS]\" | |\n| Get-NetAdapter | Where-Object { $_.Status -ne \"Not Present\" } | Sort-Object Status | ForEach-Object { | |\n| $speed = if ($_.Status -eq \"Up\") { \"Speed: $($_.LinkSpeed)\" } else { \"Speed: N/A\" } | |\n| Write-Host \" [$($_.Status.ToUpper().PadRight(12))] $($_.Name) | $($_.InterfaceDescription) | $speed\" | |\n| } | |\n| # --- System Settings --- | |\n| Write-Host \"`n[SYSTEM SETTINGS]\" | |\n| $hiberfil = Test-Path \"C:\\hiberfil.sys\" | |\n| Write-Host \"Hibernation file present : $hiberfil\" | |\n| $gp = Get-ItemProperty \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" -ErrorAction SilentlyContinue | |\n| Write-Host \"HiberbootEnabled (Fast Startup) : $($gp.HiberbootEnabled)\" | |\n| # --- Startup Programs (fixed: check registry for enabled/disabled state) --- | |\n| Write-Host \"`n[STARTUP PROGRAMS]\" | |\n| # Build a set of disabled startup item names from StartupApproved registry keys | |\n| $disabledNames = @{} | |\n| $approvedPaths = @( | |\n| \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved\\Run\", | |\n| \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved\\Run\", | |\n| \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved\\Run32\", | |\n| \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved\\Run32\", | |\n| \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved\\StartupFolder\", | |\n| \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved\\StartupFolder\" | |\n| ) | |\n| foreach ($regPath in $approvedPaths) { | |\n| if (Test-Path $regPath) { | |\n| $item = Get-Item $regPath | |\n| foreach ($valName in $item.GetValueNames()) { | |\n| $data = $item.GetValue($valName) | |\n| # First byte: 02 = enabled, 03 = disabled | |\n| if ($data -is [byte[]] -and $data.Length -gt 0 -and $data[0] -eq 3) { | |\n| $disabledNames[$valName] = $true | |\n| } | |\n| } | |\n| } | |\n| } | |\n| Get-CimInstance Win32_StartupCommand | ForEach-Object { | |\n| $state = if ($disabledNames.ContainsKey($_.Name)) { \"DISABLED\" } else { \"ENABLED\" } | |\n| [PSCustomObject]@{ State = $state; Name = $_.Name; Command = $_.Command } | |\n| } | Sort-Object @{Expression={$_.State}; Descending=$true}, Name | ForEach-Object { | |\n| $label = if ($_.State -eq \"DISABLED\") { \"[DISABLED]\" } else { \"[ENABLED] \" } | |\n| Write-Host \" $label $($_.Name) | $($_.Command)\" | |\n| } | |\n| # --- 3rd Party Scheduled Tasks (non-Microsoft, non-Disabled) --- | |\n| Write-Host \"`n[3RD PARTY SCHEDULED TASKS (Enabled only)]\" | |\n| Get-ScheduledTask | Where-Object { | |\n| $_.TaskPath -notlike \"\\Microsoft\\*\" -and $_.State -ne \"Disabled\" | |\n| } | Sort-Object @{Expression={$_.State.ToString()}; Descending=$true}, TaskName | ForEach-Object { | |\n| Write-Host \" [$($_.State.ToString().ToUpper().PadRight(7))] $($_.TaskPath)$($_.TaskName)\" | |\n| } | |\n| Write-Host \"`n$sep\" | |\n| Write-Host \" END OF REPORT - Paste this output to Ai Agent\" | |\n| Write-Host $sep |", "url": "https://wpnews.pro/news/diagnose", "canonical_source": "https://gist.github.com/tommykho/a75c41650f8618180bff2f3a153a41f7", "published_at": "2026-06-22 04:45:51+00:00", "updated_at": "2026-06-22 05:09:09.503723+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["PowerShell", "Windows"], "alternates": {"html": "https://wpnews.pro/news/diagnose", "markdown": "https://wpnews.pro/news/diagnose.md", "text": "https://wpnews.pro/news/diagnose.txt", "jsonld": "https://wpnews.pro/news/diagnose.jsonld"}}