System

Get System Info with PowerShell (OS, CPU, RAM, Serial, Uptime)

3 min · updated June 14, 2026

The quick “what is this machine?” facts, using CIM (works in Windows PowerShell 5.1 and 7+).

Everything at once

Get-ComputerInfo | Select-Object CsName, WindowsProductName, OsVersion, CsManufacturer, CsModel

Get-ComputerInfo is thorough but a little slow; the targeted queries below are faster.

OS version & build

Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture

CPU

Get-CimInstance Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors

Total RAM (GB)

[math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1)

BIOS / machine serial number

(Get-CimInstance Win32_BIOS).SerialNumber

Uptime / last boot

(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime

On PowerShell 7+ you can also just run Get-Uptime.


Note: prefer Get-CimInstance over the older Get-WmiObject — CIM is the modern, cross-session cmdlet and is the only one in PowerShell 7+. To query a remote machine, add -ComputerName SERVER01 (CIM uses WS-Man, which is usually already enabled on servers).

← All recipes