Skip to content

Instantly share code, notes, and snippets.

@3kh0
Last active June 2, 2023 00:01
Show Gist options
  • Save 3kh0/cd1527d4a2442c7937e8acd8f1733be6 to your computer and use it in GitHub Desktop.
Save 3kh0/cd1527d4a2442c7937e8acd8f1733be6 to your computer and use it in GitHub Desktop.
$consoleWidth = [Console]::WindowWidth
$consoleHeight = [Console]::WindowHeight
$ram = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty TotalPhysicalMemory
$cpu = Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty Name
$gpuList = Get-CimInstance -ClassName Win32_VideoController | Select-Object -ExpandProperty Name
$gpu = $gpuList -join ', '
$os = (Get-WmiObject -Class Win32_OperatingSystem).Caption
$disk = Get-PSDrive -PSProvider FileSystem | Where-Object {$_.Root -like 'C:\'} | Select-Object Used, Free
$usedSpace = [math]::Round(($disk.Used / 1GB), 2)
$freeSpace = [math]::Round(($disk.Free / 1GB), 2)
$totalSpace = [math]::Round(($usedSpace + $freeSpace), 2)
$systemInfo = @"
Screen Size: $($consoleWidth) x $($consoleHeight)
RAM: $([math]::Round($ram / 1GB, 2)) GB
CPU: $($cpu)
GPU: $($gpu)
Operating System: $($os)
Storage Space: Used - $($usedSpace) GB, Free - $($freeSpace) GB (Total - $($totalSpace) GB)
"@
Write-Host $systemInfo
$systemInfo | Set-Clipboard
@3kh0
Copy link
Author

3kh0 commented Jun 1, 2023

Command to run:

IEX(New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/3kh0/cd1527d4a2442c7937e8acd8f1733be6/raw/92c012f323b326c208dbb416fa4dd6ccd92645e6/system_info.ps1')

@3kh0
Copy link
Author

3kh0 commented Jun 1, 2023

IEX(New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/3kh0/cd1527d4a2442c7937e8acd8f1733be6/raw/92c012f323b326c208dbb416fa4dd6ccd92645e6/system_info.ps1')

@3kh0
Copy link
Author

3kh0 commented Jun 2, 2023

IEX(New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/3kh0/cd1527d4a2442c7937e8acd8f1733be6/raw/92c012f323b326c208dbb416fa4dd6ccd92645e6/system_info.ps1')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment