mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-18 08:30:00 +02:00
Update the manuals in Docs/
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
## check-gpu.ps1 - check-gpu.ps1
|
||||
## The check-gpu.ps1 PowerShell Script
|
||||
|
||||
check-gpu.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
@@ -10,4 +12,50 @@
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the GPU
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries GPU details and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-gpu
|
||||
.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 {
|
||||
if ($IsLinux) {
|
||||
# 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
|
||||
"✅ $($Model): $(Bytes2String $RAMSize) RAM, $($ResWidth)x$($ResHeight) pixels, $BitsPerPixel bit, $RefreshRate Hz, driver $DriverVersion, status $Status"
|
||||
}
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1*
|
||||
|
Reference in New Issue
Block a user