Get System Information
Retrieves comprehensive system information including OS version, hardware specs, and uptime.
beginnerSystem Administrationsysteminfohardwarediagnostics
get-system-information.ps1
1$computerInfo = Get-ComputerInfo2$os = Get-CimInstance Win32_OperatingSystem34[PSCustomObject]@{5 ComputerName = $env:COMPUTERNAME6 OS = $os.Caption7 Version = $os.Version8 Architecture = $os.OSArchitecture9 LastBoot = $os.LastBootUpTime10 Uptime = (Get-Date) - $os.LastBootUpTime11 TotalRAM = [math]::Round($computerInfo.CsTotalPhysicalMemory / 1GB, 2)12 Processor = $computerInfo.CsProcessors.Name13}