Here's the updated PowerShell script that lists all display adapters (video controllers) along with their resolution, while maintaining the rest of the system information as before. This version removes the restriction to the first display adapter and ensures all are displayed.
✅ Updated Script: Get-HWSummary.ps1
<# Get-HWSummary.ps1
Shows CPU, GPU (all display adapters), 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 Adapters -------------------------------------------------
$gpus = Get-CimInstance Win32_VideoController | ForEach-Object {
[PSCustomObject]@{
Model = $_.Name
Resolution = "$($_.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(s):" -ForegroundColor Yellow
$gpus | 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
🔍 What's Changed?
-
Display Adapters:
Previously, only the first video controller was shown. Now, the script retrieves all instances of Win32_VideoController and displays each with its model and resolution.
-
Output Structure:
The section titled "Display Adapter:" is now "Display Adapter(s):" to indicate multiple entries.
-
Resolution Handling:
Each video controller's resolution is derived from the CurrentHorizontalResolution and CurrentVerticalResolution properties. If these are not available, the script may show 0x0 or similar, but this is rare.
📌 Notes
- This script assumes that all
Win32_VideoController instances represent distinct display adapters. In some systems, this may include both integrated and dedicated GPUs.
- For more detailed monitor information (e.g., physical monitors), consider using
Win32_DesktopMonitor instead, but that would require additional logic.
- Ensure you're running the script with elevated privileges if needed, though it should work fine with standard user rights.
💡 Example Output
==================== System Information ====================
CPU:
Model Speed (GHz)
----- ---------
Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz 1.30
Display Adapter(s):
Model Resolution
----- ----------
Intel(R) Iris(R) Plus Graphics 645 1920x1080
NVIDIA GeForce GTX 1650 1920x1080
Hard Drive(s):
Model Capacity (GB)
----- -----------
Samsung SSD 970 EVO 250GB 232.88
Seagate ST1000LM024 HN-M101MBB 931.51
Uptime:
2 Days 5 Hours 12 Minutes 34 Seconds
============================================================
Let me know if you'd like to extend this to show individual monitor resolutions or other hardware details!