Get-SystemInfo.ps1
Displays your computer's basic system information including OS, CPU, memory, and storage.
43 lines of PowerShell code:
# Get-SystemInfo.ps1
# Displays basic system information in a readable format
$computerSystem = Get-CimInstance -ClassName Win32_ComputerSystem
$operatingSystem = Get-CimInstance -ClassName Win32_OperatingSystem
$processor = Get-CimInstance -ClassName Win32_Processor
$disk = Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DeviceID='C:'"
$totalRAM = [math]::Round($computerSystem.TotalPhysicalMemory / 1GB, 2)
$freeRAM = [math]::Round($operatingSystem.FreePhysicalMemory / 1MB, 2)
$diskSize = [math]::Round($disk.Size / 1GB, 2)
$diskFree = [math]::Round($disk.FreeSpace / 1GB, 2)
Write-Host ""
Write-Host "=== System Information ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "Computer Name: $($computerSystem.Name)"
Write-Host "Manufacturer: $($computerSystem.Manufacturer)"
Write-Host "Model: $($computerSystem.Model)"
Write-Host ""
Write-Host "=== Operating System ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "OS Name: $($operatingSystem.Caption)"
Write-Host "Version: $($operatingSystem.Version)"
Write-Host "Architecture: $($operatingSystem.OSArchitecture)"
Write-Host ""
Write-Host "=== Processor ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "CPU: $($processor.Name)"
Write-Host "Cores: $($processor.NumberOfCores)"
Write-Host "Logical CPUs: $($processor.NumberOfLogicalProcessors)"
Write-Host ""
Write-Host "=== Memory ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "Total RAM: $totalRAM GB"
Write-Host "Free RAM: $freeRAM GB"
Write-Host ""
Write-Host "=== Storage (C: Drive) ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "Total Space: $diskSize GB"
Write-Host "Free Space: $diskFree GB"
Write-Host ""