mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-24 02:48:17 +02:00
Add check-gpu.ps1
This commit is contained in:
parent
8022c28fc7
commit
63860c3d8d
41
Scripts/check-gpu.ps1
Normal file
41
Scripts/check-gpu.ps1
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the GPU
|
||||||
|
.DESCRIPTION
|
||||||
|
This PowerShell script queries GPU details and prints it.
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-gpu
|
||||||
|
CPU is 30.3°C warm.
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz | License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
function Bytes2String { param([int64]$Bytes)
|
||||||
|
if ($Bytes -lt 1000) { return "$Bytes bytes" }
|
||||||
|
$Bytes /= 1000
|
||||||
|
if ($Bytes -lt 1000) { return "$($Bytes)KB" }
|
||||||
|
$Bytes /= 1000
|
||||||
|
if ($Bytes -lt 1000) { return "$($Bytes)MB" }
|
||||||
|
$Bytes /= 1000
|
||||||
|
if ($Bytes -lt 1000) { return "$($Bytes)GB" }
|
||||||
|
$Bytes /= 1000
|
||||||
|
return "$($Bytes)TB"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$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
|
||||||
|
"✅ $Model ($(Bytes2String $RAMSize), $ResWidth x $ResHeight pixels, $BitsPerPixel bit, $RefreshRate Hz, driver $DriverVersion, status $Status)."
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Checks the computer health
|
Checks the system health
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script checks some health parameter of the local computer.
|
This PowerShell script checks some health parameter of the local computer.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -16,6 +16,7 @@
|
|||||||
& "$PSScriptRoot/check-time-zone.ps1"
|
& "$PSScriptRoot/check-time-zone.ps1"
|
||||||
& "$PSScriptRoot/check-cpu.ps1"
|
& "$PSScriptRoot/check-cpu.ps1"
|
||||||
& "$PSScriptRoot/check-ram.ps1"
|
& "$PSScriptRoot/check-ram.ps1"
|
||||||
|
& "$PSScriptRoot/check-gpu.ps1"
|
||||||
& "$PSScriptRoot/check-smart-devices.ps1"
|
& "$PSScriptRoot/check-smart-devices.ps1"
|
||||||
& "$PSScriptRoot/check-swap-space.ps1"
|
& "$PSScriptRoot/check-swap-space.ps1"
|
||||||
& "$PSScriptRoot/check-drives.ps1"
|
& "$PSScriptRoot/check-drives.ps1"
|
||||||
|
Loading…
Reference in New Issue
Block a user