Skip to content

Instantly share code, notes, and snippets.

@lukasni
Created September 8, 2025 17:02
Show Gist options
  • Select an option

  • Save lukasni/1867dd2d1bdffba87ae2b92a5a1ee114 to your computer and use it in GitHub Desktop.

Select an option

Save lukasni/1867dd2d1bdffba87ae2b92a5a1ee114 to your computer and use it in GitHub Desktop.
# Get Computer Name
$hostname = (Get-CimInstance -ClassName Win32_ComputerSystem).Name
# Get CPU Info
$cpu = Get-CimInstance Win32_Processor | Select-Object -First 1 Name, NumberOfCores, NumberOfLogicalProcessors
# Get RAM Info (convert from KB to GB)
$ram = Get-CimInstance Win32_ComputerSystem
$totalRAMGB = [math]::Round($ram.TotalPhysicalMemory / 1GB, 2)
# Get GPU Info
$gpu = Get-CimInstance Win32_VideoController | Select-Object -First 1 Name, AdapterRAM
$gpuName = $gpu.Name
$gpuVRAMGB = if ($gpu.AdapterRAM) { [math]::Round($gpu.AdapterRAM / 1GB, 2) } else { "N/A" }
# Get Drive Info
$drives = Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" |
Select-Object DeviceID, @{Name="Size(GB)";Expression={[math]::Round($_.Size / 1GB, 2)}}, @{Name="FreeSpace(GB)";Expression={[math]::Round($_.FreeSpace / 1GB, 2)}}
# Get Windows Version
$os = Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber
Write-Host "===== System Information =====" -ForegroundColor Cyan
Write-Host "CPU: $($cpu.Name) - Cores: $($cpu.NumberOfCores), Threads: $($cpu.NumberOfLogicalProcessors)"
Write-Host "RAM: $totalRAMGB GB"
Write-Host "GPU: $gpuName - VRAM: $gpuVRAMGB GB"
Write-Host "Windows: $($os.Caption) (Version $($os.Version), Build $($os.BuildNumber))"
Write-Host ""
Write-Host "===== Drive Information =====" -ForegroundColor Cyan
$drives | Format-Table -AutoSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment