Here’s a small “drop-in” PowerShell script that grabs all the requested information and prints it out in a tidy, human-readable format.
Copy everything into, say, Get-HWSummary.ps1, then run it from an elevated (or normal) console:
<# Get-HWSummary.ps1
Shows CPU, GPU, disk(s) and system uptime
#>
# --- CPU --------------------------------------------------------------------
$cpu = Get-CimInstance Win32_Processor |
Select-Object -First 1 `
@{N = 'Model' ; E = { $_.Name } },
@{N = 'Speed (GHz)' ; E = { [math]::Round($_.MaxClockSpeed/1000,2) } }
# --- GPU / Display ----------------------------------------------------------
$gpu = Get-CimInstance Win32_VideoController |
Select-Object -First 1 `
@{N = 'Model' ; E = { $_.Name } },
@{N = 'Resolution' ; E = { "$($_.CurrentHorizontalResolution)x$($_.CurrentVerticalResolution)" } }
# --- Disks ------------------------------------------------------------------
$drives = Get-CimInstance Win32_DiskDrive |
Select-Object `
@{N = 'Model' ; E = { $_.Model } },
@{N = 'Capacity (GB)'; E = { [math]::Round($_.Size/1GB,2) } }
# --- Uptime -----------------------------------------------------------------
$boot = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
$uptimeSpan = (Get-Date) - $boot
$uptime = '{0} Days {1} Hours {2} Minutes {3} Seconds' -f `
$uptimeSpan.Days, $uptimeSpan.Hours, $uptimeSpan.Minutes, $uptimeSpan.Seconds
# --- Output -----------------------------------------------------------------
Write-Host "`n==================== System Information ====================`n" -ForegroundColor Cyan
Write-Host "CPU:" -ForegroundColor Yellow
$cpu | Format-Table -AutoSize
Write-Host "`nDisplay Adapter:" -ForegroundColor Yellow
$gpu | Format-Table -AutoSize
Write-Host "`nHard Drive(s):" -ForegroundColor Yellow
$drives | Format-Table -AutoSize
Write-Host "`nUptime:" -ForegroundColor Yellow
Write-Host " $uptime`n"
Write-Host "============================================================`n" -ForegroundColor Cyan
How it works (quick notes)
• Get-CimInstance uses the modern CIM/WMI interface that’s faster and works remotely, too.
• CPU speed comes in MHz; we just divide by 1000 and round to two decimals for GHz.
• Video resolution is pulled from Win32_VideoController’s CurrentHorizontalResolution & CurrentVerticalResolution.
• Disk size is returned in bytes—converting with 1GB gives an easy-to-read figure.
• Uptime is calculated from the OS’s LastBootUpTime.
PowerShell 3.0 or later is fine. On legacy boxes (e.g., PowerShell 2.0) replace Get-CimInstance with Get-WmiObject.