From 1e8c6ba7577980846d98fa1a6e6797ff714fdbb9 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 22 Apr 2025 17:45:03 +0200 Subject: [PATCH] Improved check-gpu.ps1 for multiple GPU's (issue #30) --- scripts/check-gpu.ps1 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/check-gpu.ps1 b/scripts/check-gpu.ps1 index aa4789e2..d5f4f7ff 100755 --- a/scripts/check-gpu.ps1 +++ b/scripts/check-gpu.ps1 @@ -9,7 +9,7 @@ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz | License: CC0 + Author: Markus Fleschutz, Tyler MacInnis | License: CC0 #> function Bytes2String { param([int64]$Bytes) @@ -29,15 +29,17 @@ try { # TODO } else { $Details = Get-WmiObject Win32_VideoController - $Model = $Details.Caption - $RAMSize = $Details.AdapterRAM - $ResWidth = $Details.CurrentHorizontalResolution - $ResHeight = $Details.CurrentVerticalResolution - $BitsPerPixel = $Details.CurrentBitsPerPixel - $RefreshRate = $Details.CurrentRefreshRate - $DriverVersion = $Details.DriverVersion - $Status = $Details.Status - Write-Host "✅ $Model GPU ($(Bytes2String $RAMSize) RAM, $($ResWidth)x$($ResHeight) pixels, $($BitsPerPixel)-bit, $($RefreshRate)Hz, driver $DriverVersion) - status $Status" + foreach ($GPU in $Details) { + $Model = $GPU.Caption + $RAMSize = $GPU.AdapterRAM + $ResWidth = $GPU.CurrentHorizontalResolution + $ResHeight = $GPU.CurrentVerticalResolution + $BitsPerPixel = $GPU.CurrentBitsPerPixel + $RefreshRate = $GPU.CurrentRefreshRate + $DriverVersion = $GPU.DriverVersion + $Status = $GPU.Status + Write-Host "✅ $Model GPU ($(Bytes2String $RAMSize) RAM, $($ResWidth)x$($ResHeight) pixels, $($BitsPerPixel)-bit, $($RefreshRate)Hz, driver $DriverVersion) - status $Status" + } } exit 0 # success } catch {