$ErrorActionPreference = 'SilentlyContinue' $site = 'https://doesitrun.com' $code = '' Write-Host '' Write-Host ' Steam Library Hardware Check - hardware detector' -ForegroundColor Cyan Write-Host ' Reads only: CPU, GPU, RAM, free disk space and the numbers of installed Steam games.' Write-Host ' Does NOT read your files, passwords or browser data. Installs nothing.' Write-Host ' You see the result first - it is only sent when you press Enter.' Write-Host '' # CPU $cpuObj = Get-CimInstance Win32_Processor | Select-Object -First 1 $cpu = ([string]$cpuObj.Name).Trim() $threads = [int]$cpuObj.NumberOfLogicalProcessors # RAM $ram = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1) # RAM type and speed (SMBIOS memory type codes) $memTypes = @{ 24 = 'DDR3'; 26 = 'DDR4'; 29 = 'DDR3'; 30 = 'DDR4'; 34 = 'DDR5'; 35 = 'DDR5' } $ramType = '' $ramMhz = 0 foreach ($m in @(Get-CimInstance Win32_PhysicalMemory)) { $tc = [int]$m.SMBIOSMemoryType if (-not $memTypes.ContainsKey($tc)) { $tc = [int]$m.MemoryType } if (-not $ramType -and $memTypes.ContainsKey($tc)) { $ramType = $memTypes[$tc] } $sp = [int]$m.ConfiguredClockSpeed if (-not $sp) { $sp = [int]$m.Speed } if ($sp -gt $ramMhz) { $ramMhz = $sp } } # GPUs with real VRAM (WMI AdapterRAM is capped at 4 GB, so prefer the driver registry value) $regKeys = @(Get-ItemProperty 'HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*') $gpus = @() foreach ($g in @(Get-CimInstance Win32_VideoController)) { $name = ([string]$g.Name).Trim() if (-not $name) { continue } # virtual and remote-desktop display adapters are not graphics cards if ($name -match 'Citrix|Basic Display|Basic Render|Remote|Virtual|Parsec|Indirect Display|Mirror|DisplayLink|spacedesk|Hyper-V|VMware|VirtualBox|Luminon|IddCx') { continue } $vram = $null $r = $regKeys | Where-Object { $_.DriverDesc -eq $name } | Select-Object -First 1 if ($r) { $mem = $r.'HardwareInformation.qwMemorySize' if (-not $mem) { $mem = $r.'HardwareInformation.MemorySize' } if ($mem -is [byte[]]) { $pad = New-Object byte[] 8; [Array]::Copy($mem, $pad, [Math]::Min(8, $mem.Length)); $mem = [BitConverter]::ToUInt64($pad, 0) } if ($mem) { $vram = [math]::Round([double]$mem / 1GB, 1) } } if (-not $vram -and $g.AdapterRAM) { $vram = [math]::Round([double]$g.AdapterRAM / 1GB, 1) } $gpus += [pscustomobject]@{ n = $name; v = $vram } } $smi = Get-Command nvidia-smi.exe -ErrorAction SilentlyContinue if ($smi) { foreach ($line in (& nvidia-smi.exe '--query-gpu=name,memory.total' '--format=csv,noheader,nounits')) { $parts = $line.Split(',') if ($parts.Length -ge 2) { $sn = $parts[0].Trim(); $sv = [math]::Round([double]$parts[1].Trim() / 1024, 1) $hit = $gpus | Where-Object { $_.n -like ('*' + ($sn -replace '^NVIDIA ', '') + '*') } | Select-Object -First 1 if ($hit) { $hit.v = $sv } else { $gpus += [pscustomobject]@{ n = $sn; v = $sv } } } } } # Free disk space (largest free space on a local drive) $free = 0 foreach ($d in @(Get-CimInstance Win32_LogicalDisk -Filter 'DriveType=3')) { $f = [math]::Round([double]$d.FreeSpace / 1GB) if ($f -gt $free) { $free = $f } } # Installed Steam games $steamPaths = @() $sp = (Get-ItemProperty 'HKCU:\Software\Valve\Steam').SteamPath if ($sp) { $steamPaths += ($sp -replace '/', '\') } $sp2 = (Get-ItemProperty 'HKLM:\SOFTWARE\WOW6432Node\Valve\Steam').InstallPath if ($sp2) { $steamPaths += $sp2 } $steamPaths += 'C:\Program Files (x86)\Steam' $libs = @() foreach ($p in ($steamPaths | Select-Object -Unique)) { $vdf = Join-Path $p 'steamapps\libraryfolders.vdf' if (Test-Path -LiteralPath $vdf) { $libs += $p foreach ($m in [regex]::Matches((Get-Content -LiteralPath $vdf -Raw), '"path"\s+"([^"]+)"')) { $libs += ($m.Groups[1].Value -replace '\\\\', '\') } } } $apps = @() foreach ($lib in ($libs | Select-Object -Unique)) { foreach ($f in @(Get-ChildItem -LiteralPath (Join-Path $lib 'steamapps') -Filter 'appmanifest_*.acf')) { if ($f.Name -match '^appmanifest_(\d+)\.acf$') { $apps += $Matches[1] } } } $apps = @($apps | Select-Object -Unique) $data = [ordered]@{ v = 1; os = 'windows'; cpu = $cpu; t = $threads; ram = $ram; rt = $ramType; rs = $ramMhz; gpus = @($gpus); free = $free; inst = ($apps -join ',') } $jsonText = $data | ConvertTo-Json -Compress -Depth 4 $b64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($jsonText)).TrimEnd('=').Replace('+', '-').Replace('/', '_') Write-Host (' CPU: ' + $cpu + ' (' + $threads + ' threads)') foreach ($g in $gpus) { Write-Host (' GPU: ' + $g.n + $(if ($g.v) { ' (' + $g.v + ' GB VRAM)' } else { '' })) } Write-Host (' RAM: ' + $ram + ' GB ' + $ramType + $(if ($ramMhz) { ' ' + $ramMhz + ' MHz' } else { '' })) Write-Host (' Disk: ' + $free + ' GB free (largest drive)') Write-Host (' Installed Steam games: ' + $apps.Count) Write-Host '' Write-Host ' That is everything that will be sent - nothing else.' Write-Host '' $hostName = ([Uri]$site).Host Write-Host ' ============================================================' -ForegroundColor Green Write-Host ' >> Press ENTER to send this to the website <<' -ForegroundColor Green Write-Host (' ' + $hostName) -ForegroundColor Green Write-Host ' (or type N and press Enter to cancel)' -ForegroundColor DarkGray Write-Host ' ============================================================' -ForegroundColor Green Write-Host -NoNewline ' > ' $answer = [Console]::ReadLine() if ($answer -match '^\s*[nN]') { Write-Host ' Cancelled - nothing was sent.' -ForegroundColor Yellow # only tell the waiting browser tab that you cancelled (no hardware data) if ($code) { try { Invoke-RestMethod -Method Post -Uri ($site + '/api/hwdrop?c=' + $code) -Body 'cancelled_by_user' -ContentType 'text/plain' -TimeoutSec 10 | Out-Null } catch { } } return } $sent = $false if ($code) { # hand the result to the browser tab that downloaded the detector - no second browser window try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 Invoke-RestMethod -Method Post -Uri ($site + '/api/hwdrop?c=' + $code) -Body $b64 -ContentType 'text/plain' -TimeoutSec 15 | Out-Null $sent = $true Write-Host ' Done - your hardware now appears in the browser tab you downloaded this from.' -ForegroundColor Green } catch { Write-Host ' Could not reach the website directly - opening it instead.' } } if (-not $sent) { Write-Host ' Opening the website in your browser...' -ForegroundColor Green Start-Process ($site + '/#hw=' + $b64) }